using System;
using IWshRuntimeLibrary;
namespace ShortcutToDesktop
{
class Shortcut
{
[STAThread]
static void Main(string[] args)
{
//
// Создать ярлык на рабочем столе
//
object shortPath = (object)"Desktop";
WshShell shell = new WshShell();
// Получить полный адрес ярлыка
string link = ((string) shell.SpecialFolders.Item(
ref shortPath)) + @"\notepad.lnk";
//
// Создать объект ярлыка
//
IWshShortcut shortcut =(IWshShortcut)shell.CreateShortcut(link);
//
// Горячая клавиша
//
shortcut.Hotkey = "CTRL+SHIFT+N";
//
// Описание ярлыка
//
shortcut.Description = "Ярлык для Notepad";
//
// Путь для программы "Notepad"
//
shortcut.TargetPath =Environment.GetFolderPath(
Environment.SpecialFolder.System) +
@"\notepad.exe";
//
// Создать ярлык
//
shortcut.Save();
}
}
}