我正在使用以下脚本创建快捷方式:
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
Run Code Online (Sandbox Code Playgroud)
在oShellLink.TargetPath = "C:\Windows\System32\mshta.exe D:\path\to\file.hta"它卡住,因为在目标路径的空间.怎么做到这一点?我也试过像这样操纵字符串.
"C:\Windows\System32\mshta.exe" & " " & """" & "D:\PLR\software\plrplus.dll" & """"
Run Code Online (Sandbox Code Playgroud)
如有疑问,请阅读文档.
From TargetPath属性 - 备注部分
此属性仅适用于快捷方式的目标路径.快捷方式的任何参数都必须放在Argument的属性中.
命令的参数属于Arguments属性:
Set oShellLink = objShell.CreateShortcut("shortcut.lnk")
oShellLink.TargetPath = "C:\Windows\System32\mshta.exe"
oShellLink.Arguments = "D:\path\to\file.hta"
...
oShellLink.Save
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
989 次 |
| 最近记录: |