当我尝试运行脚本时,它会抛出错误,指出该文件不存在。 在脚本上,它确实存在echos文件。 试过了 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
答案 0 :(得分:5)
Apppath包含空格。尝试用引号括起来。
objshell.run vbQuote & apppath & vbQuote