给windows应用程序创建快捷方式
2013-10-12 16:07
148 查看
static void Main()
{
WshShell shell = new WshShell();
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(
Environment.GetFolderPath(Environment.SpecialFolder.StartMenu) +
"\" + "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();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
{
WshShell shell = new WshShell();
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(
Environment.GetFolderPath(Environment.SpecialFolder.StartMenu) +
"\" + "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();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
相关文章推荐
- Windows应用程序快捷方式创建工具
- Windows应用程序快捷方式创建工具
- CentOS下创建应用程序的快捷方式
- ubuntu 在桌面上创建应用程序图标(快捷方式)
- Windows Moible 5 Config(内部资料) 配置三 创建快捷方式
- ubuntu16.04下给直接解压免安装的应用程序创建启动器(快捷方式)
- Android之快捷方式一——通过应用程序创建快捷方式
- windows命令行创建各种快捷方式
- Android之快捷方式一——通过应用程序创建快捷方式
- 给当前应用程序创建在“启动”目录下的快捷方式
- 如何在windows中创建到活动目录的快捷方式
- Android通过应用程序创建快捷方式的方法
- Windows下c++创建快捷方式
- vc++ windows 创建桌面快捷方式
- Android 为应用程序创建桌面快捷方式
- linux\ubuntunutlinux下ubuntu 为应用程序创建快捷方式
- linux应用程序创建快捷启动方式
- VC学习资料收集(24):在应用程序中创建快捷方式
- 在Windows桌面创建快捷方式