3

我正在尝试创建一个 VBScript 来更改链接中的目标

目前的目标是

"C:\Program Files\Hyland\Application Enabler\AEClient.exe"

我希望新的目标是

"C:\Program Files\Hyland\Application Enabler\AEClient.exe" \\rrscwpappimg02\Workflow\CWF\AppEnabler\CombinedCWF.xml

这是我到目前为止的脚本。我在第 4 char 78 行不断收到错误消息:

Set wsc = WScript.CreateObject("WScript.Shell")
Set lnk = wsc.CreateShortcut(wsc.SpecialFolders("desktop") & "\AE Client.LNK")

lnk.targetpath = "C:\Program Files\Hyland\Application Enabler\AEClient.exe"      \\rrscwpappimg02\Workflow\CWF\AppEnabler\CombinedCWF.xml
lnk.description = "AE Client"
lnk.workingdirectory = "C:\Program Files (x86)\Hyland\Application Enabler\"
lnk.save`

任何帮助将不胜感激。

即使只是创建在桌面上工作的快捷方式的脚本也可以工作。

4

2 回答 2

7

这是您问题的完整解决方案:

Set wsc = WScript.CreateObject("WScript.Shell")
Set lnk = wsc.CreateShortcut(wsc.SpecialFolders("desktop") & "\AE Client.LNK")

lnk.targetpath = "C:\Program Files\Hyland\Application Enabler\AEClient.exe"
lnk.Arguments = "\\rrscwpappimg02\Workflow\CWF\AppEnabler\CombinedCWF.xml"
lnk.save
于 2014-03-04T18:53:48.033 回答
1

The target path must be a string, so you need to change this:

lnk.targetpath = "C:\path\to\your.exe" \\server\share\path\to\file.xml

into this:

lnk.targetpath = """C:\path\to\your.exe"" \\server\share\path\to\file.xml"

Strings in VBScript must be in double quotes. Nested double quotes inside a string can be escaped by doubling them.

于 2012-10-29T20:40:07.797 回答