2

当我尝试运行脚本时,它会抛出文件不存在的错误。在脚本上它确实会回显文件存在。已尝试使用 objshell.run """apppath""" 但没有运气.. :( 请帮忙。

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
AppPath =  objshell.ExpandEnvironmentStrings("%ProgramFiles%") + "\ERUNT\ERUNT.EXE"
wscript.echo apppath
if fx = objfso.FileExists("apppath") then
wscript.Echo "File Exists"
objshell.run apppath
Else
Wscript.echo "File Does not Exist"
end IF 
4

1 回答 1

5

Apppath 包含空格。尝试用引号括起来。

objshell.run vbQuote & apppath & vbQuote
于 2012-07-06T13:55:13.250 回答