引用COM组件Windows Script Host Object Model;
IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShellClass();
IWshRuntimeLibrary.IWshShortcut shortcut =(IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut("c://a.lnk");
shortcut.TargetPath = "指向地址.exe";
shortcut.Arguments = "参数";
shortcut.Description = "我是快捷方式名字哦!";
shortcut.Hotkey = "CTRL+SHIFT+N";
shortcut.IconLocation = "notepad.exe, 0";
shortcut.Save();
读取也一样的,上面的几个设置都是属性。
本文介绍如何使用C#和Windows Script Host Object Model创建快捷方式,包括设置目标路径、参数、描述、热键及图标位置等。
6061

被折叠的 条评论
为什么被折叠?



