passing variable from vbscript to batch file

后端 未结 1 400
执笔经年
执笔经年 2021-01-23 12:14

i am using vbscript to call a batch file. my script looks like:

dim shell  
set shell=createobject(\"wscript.shell\")  
shell.run \"a.bat\"  
set shell=nothing         


        
1条回答
  •  礼貌的吻别
    2021-01-23 12:44

    I think that you can just pass variables to the batch file. You can call it like:

    shell.run "a.bat var1 var2"
    

    And in your batch file, you can refer to them as:

    %1 for "var1"
    %2 for "var2"
    

    And you can do this from %1 to %9.

    0 讨论(0)
提交回复
热议问题