我在第 6 行收到一个错误,即带有 lnk.TargetPath 的那个参数无效。我希望在桌面的开始菜单下创建一个指向该程序的链接。有人知道它为什么这样做吗?
Set objShell = WScript.CreateObject("WScript.Shell")
Set lnk = objShell.CreateShortcut("C:\Users\%USERDATA%\Desktop\Shutdown.LNK")
Dim strUserProfile
strUserProfile = objShell.ExpandEnvironmentStrings("%USERPROFILE%")
lnk.TargetPath = "C:\Users\" & strUserProfile & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\shutdown.bat"
lnk.Arguments = ""
lnk.Description = "Shutdown"
'lnk.HotKey = "ALT+CTRL+F"
lnk.IconLocation = "C:\Users\" & strUserProfile & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\shutdown.bat, 2"
lnk.WindowStyle = "1"
lnk.WorkingDirectory = "C:\Users\" & strUserProfile &"\AppData\Roaming\Microsoft\Windows\Start Menu\Programs"
lnk.Save
Set lnk = Nothing