开发者

passing variable from vbscript to batch file

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 开发者_StackOverflow社区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"

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜