ابتدا روی پروژه کلیک راست کرده، Add Reference و در Tab مربوط به COM مورد Windows Script Host Object Model را اضافه نمایید. سپس :
using IWshRuntimeLibrary;
public static void CreateShortcut(string destination)
{
WshShell wshShell = new WshShell();
object destFolder = (object)destination;
string fileName = Path.Combine(
(string)wshShell.SpecialFolders.Item(ref destFolder),
"Notepad.lnk"
);
IWshShortcut shortcut =
(IWshShortcut)wshShell.CreateShortcut(fileName);
shortcut.TargetPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolde r.System),
"notepad.exe"
);
shortcut.WorkingDirectory =
Environment.GetFolderPath(Environment.SpecialFolde r.Personal);
shortcut.Description = "Notepad Text Editor";
shortcut.Hotkey = "CTRL+ALT+N";
// Configure Notepad to always start maximized.
shortcut.WindowStyle = 3;
// Configure the shortcut to display the first icon in Notepad.exe.
shortcut.IconLocation = "notepad.exe, 0";
shortcut.Save();
}
نحوه ی استفاده :
CreateShortcut("Desktop");
CreateShortcut("StartMenu");
منبع : Visual C# 2005 Recipes: A Problem-Solution Approach
یک مثال دیگر : http://www.codeproject.com/KB/dotnet/shelllink.aspx