Created
May 18, 2015 16:05
-
-
Save litefeel/85310362869d38543c17 to your computer and use it in GitHub Desktop.
设置快捷方式
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Dim wshShell, shortcut | |
Dim lnkpath, targetpath | |
' 生成的快捷方式文件路径, 必须是.lnk结尾 | |
lnkpath = WScript.Arguments(0) | |
' 目标文件路径 | |
targetpath = WScript.Arguments(1) | |
WScript.Echo lnkpath | |
WScript.Echo targetpath | |
Set wshShell = WSH.CreateObject("WScript.Shell") | |
' strDir = wshShell.SpecialFolders("Startup") | |
Set shortcut = wshShell.CreateShortcut(lnkpath) | |
shortcut.TargetPath = targetpath | |
shortcut.WindowStyle = 1 | |
shortcut.Save | |
Set shortcut = Nothing | |
Set wshShell = Nothing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment