当我尝试从vbs执行bat时出现错误800A0401

时间:2016-09-02 15:24:27

标签: batch-file command-line vbscript

Set WshShell = WScript.CreateObject( "WScript.Shell" )
Dim strCurDir

strCurDir = WshShell.CurrentDirectory

WshShell.Run  strCurDir & "\Advertise.bat", 0, True
Wscript.Sleep(2)

WshShell.Run strCurDir &  "\Uninstall.bat", 0, True
Wscript.Sleep(2)

WshShell.Run strCurDir "\Install.bat", 0, True


Set WshShell = Nothing
Wscript.quit

我正在尝试在命令行中执行此脚本。我正在

  

错误800A0401-预期的结束语句。来源:Microsoft VBScript   编译错误。

1 个答案:

答案 0 :(得分:3)

WshShell.Run strCurDir "\Install.bat", 0, True

==>

WshShell.Run strCurDir & "\Install.bat", 0, True

下次发布错误行号。