andy_tigger

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
导入COM组件Windows Script Host Object Model
using IWshRuntimeLibrary;


WshShell shell = new WshShell();
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(
  Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) +
  "\\" + "Allen's Application.lnk"
  );
shortcut.TargetPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
shortcut.WorkingDirectory = System.Environment.CurrentDirectory;
shortcut.WindowStyle = 1;
shortcut.Description = "Launch Allen's Application";
shortcut.IconLocation = System.Environment.SystemDirectory + "\\" + "shell32.dll, 165";
shortcut.Save();
posted on 2010-10-22 18:18  andy_tigger  阅读(208)  评论(0编辑  收藏  举报