Skip to content

Instantly share code, notes, and snippets.

@litefeel
Created May 18, 2015 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save litefeel/85310362869d38543c17 to your computer and use it in GitHub Desktop.
Save litefeel/85310362869d38543c17 to your computer and use it in GitHub Desktop.
设置快捷方式
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