导入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();

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-12
  • 2022-02-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-04
  • 2021-06-07
  • 2021-10-20
  • 2021-09-30
  • 2021-07-09
  • 2021-10-23
相关资源
相似解决方案