将变量从 vbscript 传递到批处理文件 [英] passing variable from vbscript to batch file
本文介绍了将变量从 vbscript 传递到批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 vbscript 调用批处理文件.我的脚本看起来像:
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
我的批处理文件很简单,看起来像:
my batch file is simple and looks like:
D:
cd D:\d
winzip32.exe -min -a D:\a
我想将一个变量从脚本传递到批处理文件.让我们说目标文件夹.
我该怎么做?
非常感谢任何帮助.
i want to pass a variable from a script to the batch file. lets say the destination folder.
how do i do that?
any help is very much appreciated.
推荐答案
我认为您可以将变量传递给批处理文件.你可以这样称呼它:
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"
您可以从 %1 到 %9 执行此操作.
And you can do this from %1 to %9.
这篇关于将变量从 vbscript 传递到批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文