Get one batch file variable in to another batch file too

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
redro
Posts: 11
Joined: 12 May 2010 05:24

Get one batch file variable in to another batch file too

#1 Post by redro » 14 May 2010 06:19

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

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

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

#2 Post by avery_larry » 14 May 2010 08:41

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.

Post Reply