VbScript脚本方式创建桌面快捷方式

来源:互联网 发布:电脑跑分软件 编辑:程序博客网 时间:2024/06/02 03:09
'以下为VbScript脚本Set WshShell = WScript.CreateObject("WScript.Shell")appdataDir = WshShell.SpecialFolders("APPDATA") '获取"程序数据"目录currentDir = WshShell.CurrentDirectory '获取脚本当前目录desktopDir = WshShell.SpecialFolders("Desktop") '获取"桌面"文件夹目录taskbarDir = appdataDir & "\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar"CreateLnk(desktopDir)'桌面快捷'在指定路径创建一个360极速浏览器的快捷方式Sub CreateLnk(str)Set oShellLink = WshShell.CreateShortcut(str & "\360极速浏览器.lnk")oShellLink.TargetPath = currentDir & "\360chrome.exe" '目标oShellLink.WindowStyle = 3 '参数1默认窗口激活,参数3最大化激活,参数7最小化oShellLink.Description = "360极速浏览器快捷方式" '备注oShellLink.WorkingDirectory = str '起始位置oShellLink.Save '创建保存快捷方式End Sub' 删除脚本自身Set fso = CreateObject("Scripting.FileSystemObject") f = fso.DeleteFile(WScript.ScriptName) 

0 0
原创粉丝点击