VBS建立快捷方式
版本一:
? ? ? ? ?set WshShell = WScript.CreateObject("WScript.Shell") ?'設置CreateObject 方法
? ? ? ? ?strDesktop = WshShell.SpecialFolders("Desktop") '取得“桌面”的路徑
? ? ? ? ?set oShellLink = WshShell.CreateShortcut(strDesktop & "\騰訊QQ.lnk") ?'設置快捷方式將要保存到的路徑和快捷方式名,你也可以指定一個真實存在的路徑,這個范例是創建到桌面
? ? ? ? ?oShellLink.TargetPath = "d:\qq\QQ***清除.vbs" '快捷方式里的“目標”
? ? ? ? ?oShellLink.WindowStyle = 1 ?'快捷方式里的“運行方式”
? ? ? ? ?oShellLink.Hotkey = "Ctrl+Alt+e" ?'快捷方式里的“快捷鍵”
? ? ? ? ?oShellLink.IconLocation = "d:\qq\qq.exe, 0" ?'快捷方式的圖標
? ? ? ? ?oShellLink.Description = "騰訊QQ" ?'快捷方式里的“備注”
? ? ? ? ?oShellLink.WorkingDirectory = "d:\qq" ?'快捷方式里的“起始位置”
? ? ? ? ?oShellLink.Save '建立快捷方式
版本二:
? ? ? ? 如果是創建程序的快捷方式,以下代碼即可:
? ? ? ? ?set WshShell = WScript.CreateObject("WScript.Shell") ?'設置CreateObject 方法
? ? ? ? ?strDesktop = WshShell.SpecialFolders("Desktop") '取得“桌面”的路徑
? ? ? ? ?set oShellLink = WshShell.CreateShortcut(strDesktop & "\騰訊QQ.lnk") ?'設置快捷方式將要保存到的路徑和快捷方式名,你也可以指定一個真實存在的路徑,這個范例是創建到桌面
? ? ? ? ?oShellLink.TargetPath = "d:\qq\QQ***清除.vbs" '快捷方式里的“目標”
? ? ? ? ?oShellLink.WorkingDirectory = "d:\qq" ?'快捷方式里的“起始位置”
? ? ? ? ?oShellLink.Save '建立快捷方式?
轉載于:https://blog.51cto.com/martin001/1533248
總結
- 上一篇: Socket网络编程--聊天程序(8)
- 下一篇: oracle spfile和pfile文