我正在尝试创建一个运行文件的脚本,问题是文件夹中的字符是“[]”,每次我尝试打开它时都会显示错误,说明找不到路径。 ..因为我会忽略这个角色?
Sub Main()
If WScript.Arguments.Count >= 1 Then
MyFileSWF = WScript.Arguments.Item(0)
Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.run "CMD /C Start /Max "" ""[ Utilities ]\Flash Player Standalone 18.exe"" " & """" & MyFileSWF & """", 0, True
End If
End Sub
On Error Resume Next
Main
If Err.Number Then
WScript.Quit 4711
End If
答案 0 :(得分:1)
此:
"CMD /C Start /Max "" ""[ Utilities ]\Flash Player Standalone 18.exe"" " & """" & MyFileSWF & """"
被解释为:
CMD /C Start /Max " "[ Utilities ]\Flash Player Standalone 18.exe" "%swfFile%"
请注意目录名称(带方括号)实际上是如何从第一个引号括起的字符串中排除的。
将其更改为:
"CMD /C Start /Max ""[ Utilities ]\Flash Player Standalone 18.exe"" """ & MyFileSWF & """"