Page 1 of 1

Get one batch file variable in to another batch file too

Posted: 14 May 2010 06:19
by redro
Hi All,

I want to get one variable in both batch files.

Ex: I have declared the variable in 1.bat file the same variable and value i want to use in 2.bat
pls suggest me.

Thanks,
JP

Re: Get one batch file variable in to another batch file too

Posted: 14 May 2010 08:41
by avery_larry
system variables could be used. See the command setx

tmp files can pass information back and forth between batch files, using the for statement.

Batch files that are called by other batch files will have the variables already defined (typically), and any changes will propogate, as long as it's all in 1 thread.