创建快捷方式工具类
/// <summary>
/// 创建快捷方式
/// </summary>
/// <param name="FileStreamPath">程序所在路径</param>
public static void CreateShortCut(string FileStreamPath)
{
string DesktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup);//快捷方式放在Startup启动文件夹
WshShell shell = new WshShell();
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(DesktopPath + "\\nginx.e.lnk");//快捷方式名字
shortcut.TargetPath = FileStreamPath;
shortcut.Arguments = "";
shortcut.Description = "开机启动";//描述
shortcut.WorkingDirectory = FileStreamPath;
shortcut.Hotkey = "CTRL+SHIFT+Z";//快捷键
shortcut.WindowStyle = 1;
shortcut.Save();
}