How to pass a parameter from Batch (.bat) to VBScript (.vbs)?

后端 未结 3 1458
难免孤独
难免孤独 2021-01-01 03:13

How can I pass a parameter from batch to vbscript? My batch script sends out an email at the end of the automated execution. For that it uses/calls my vbscript (email.vbs) t

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-01 03:51

    To answer the question...

    invoke your script this way:

    cscript //nologo success_mail_DEV.vbs  ARG1  ARG2
    

    Handle arguments within vbscript via WScript.Arguments.


    But may I also suggest that you could eliminate the batch portion of the system completely.

    VBSCript is perfectly capable of invoking FINDSTR and handling the output. Or in fact you could implement the search wholly within VBScript with no need to invoke FINDSTR at all.

提交回复
热议问题