Create short cut

Add COM reference

Windows Script Host Object Model

---------------

    WshShell shell = new WshShell();
        IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + "\\" + "Application Examp.lnk");
        shortcut.TargetPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
        shortcut.WorkingDirectory = System.Environment.CurrentDirectory;
        shortcut.WindowStyle = 1;
        shortcut.Description = "Application";
        shortcut.IconLocation = System.Environment.SystemDirectory + "\\" + "shell32.dll, 121";
        shortcut.Save();

posted @ 2010-06-27 20:29  greencolor  阅读(224)  评论(0编辑  收藏  举报