Private void CreateLink (string linkName, string ExeName, string Description)
{
WshShell shell = new WshShell ();
IWshShortcut shortcut = (IWshShortcut) shell. CreateShortcut (linkName );
Export cut. TargetPath = ExeName;
Export cut. WorkingDirectory = Path. GetDirectoryName (ExeName );
Export cut. WindowStyle = 1;
Export cut. Description = Description;
Export cut. IconLocation = System. Environment. SystemDirectory + "\" + "shell32.dll, 165 ";
Shortcut cut. Save ();
}
Private void button3_Click (object sender, EventArgs e)
{
CreateLink (Application. StartupPath + "/ l. lnk", @ "D: \ temp \ Anhui. mxd", "");
// WshShell shell = new WshShell ();
// IWshShortcut shortcut = (IWshShortcut) shell. CreateShortcut (
// Environment. GetFolderPath (Environment. SpecialFolder. Exclude topdirectory) +
// "\" + "Allen's Application. lnk"
//);
// Export cut. TargetPath = System. Reflection. Assembly. GetExecutingAssembly (). Location;
// Export cut. WorkingDirectory = System. Environment. CurrentDirectory;
// Export cut. WindowStyle = 1;
// Export cut. Description = "Launch Allen's Application ";
// Export cut. IconLocation = System. Environment. SystemDirectory + "\" + "shell32.dll, 165 ";
// Shortcut cut. Save ();
}
From gisoracle