如何创build有两个目标的快捷方式

我正在使用以下脚本创build一个快捷方式:

Set oShellLink = objShell.CreateShortcut("shortcut.lnk") oShellLink.TargetPath = "C:\Windows\System32\mshta.exe D:\path\to\file.hta" oShellLink.WindowStyle = 1 oShellLink.IconLocation = "logo.ico" oShellLink.Description = "app" oShellLink.WorkingDirectory = desktop oShellLink.Save 

oShellLink.TargetPath = "C:\Windows\System32\mshta.exe D:\path\to\file.hta"中,由于目标path中有空格,所以卡住了。 如何做到这一点? 我也尝试过这样操纵string。

 "C:\Windows\System32\mshta.exe" & " " & """" & "D:\PLR\software\plrplus.dll" & """" 

如有疑问,请阅读文档 。

从TargetPath属性 – 备注部分
该属性仅用于快捷方式的目标路径。 任何参数的快捷方式必须放置在参数的属性。

一个命令的Arguments属于Arguments属性:

 Set oShellLink = objShell.CreateShortcut("shortcut.lnk") oShellLink.TargetPath = "C:\Windows\System32\mshta.exe" oShellLink.Arguments = "D:\path\to\file.hta" ... oShellLink.Save