Cannot use parentheses when calling a Sub Error 800A0414 VBS

后端 未结 3 1529
既然无缘
既然无缘 2020-11-27 06:40

I am getting the 800A0414 error in lines 7 and 12 of this script:

Module Module1

  Dim p

    Sub Main()
        CreateObject(\"Wscript.Shell\").Run(\"progr         


        
3条回答
  •  遥遥无期
    2020-11-27 07:33

    When you enclose a procedure's argument list in parentheses, you must use the Call keyword:

    Call CreateObject("WScript.Shell").Run("program.bat", 0, True)
    

    If you omit the Call keyword, you must also drop parentheses:

    CreateObject("WScript.Shell").Run "program.bat", 0, True
    

提交回复
热议问题