【问题标题】:Error 800A0401 when i try to execute bat from vbs当我尝试从 vbs 执行 bat 时出现错误 800A0401
【发布时间】:2016-09-02 15:24:27
【问题描述】:
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 - 预期语句结束。来源:微软 VBScript 编译错误。

【问题讨论】:

    标签: batch-file command-line vbscript


    【解决方案1】:
    WshShell.Run strCurDir "\Install.bat", 0, True
    

    ==>

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

    下次公布错误行号。

    【讨论】:

      猜你喜欢
      • 2022-01-15
      • 2020-02-11
      • 1970-01-01
      • 1970-01-01
      • 2011-09-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-26
      相关资源
      最近更新 更多