按照ss64的说明,我创建了一个 vbs 来创建快捷方式
我的test.vbs
Set objShell = WScript.CreateObject("WScript.Shell")
Set lnk = objShell.CreateShortcut("%HOMEDRIVE%\Users\Public\Desktop\test.lnk")
lnk.TargetPath = "%HOMEDRIVE%\test\start.bat"
lnk.Arguments = ""
lnk.Description = "test"
lnk.HotKey = "ALT+CTRL+F"
lnk.IconLocation = "%HOMEDRIVE%\test\test.ico, 0"
lnk.WindowStyle = "1"
lnk.WorkingDirectory = "%HOMEDRIVE%\test\"
lnk.Save
'Clean up
Set lnk = Nothing
出去
Error: Could not save shortcut
"c:\test\%HOMEDRIVE%\Users\Public\Desktop\test.ink"
如果我将快捷方式的路径从更改"%HOMEDRIVE%\Users\Public\Desktop\test.lnk"
为仅在文件夹test.ink
内成功创建快捷方式test
如何在路径中创建快捷方式"%HOMEDRIVE%\Users\Public\Desktop\test.lnk"
?
解决了。这是正确的 vbs 代码
资料来源:social.technet.microsoft.com