how could i know whether a variable has been defined in command line?

T

thinktwice

//file 1.bat
@call file3.bat

//file 2.bat
@call file1.bat
@call file3.bat

//file3.bat
if variable_a has been defined (goto eof ) else (define variable_a)

i don't want to run the same batch file more than once.
 
P

Pegasus \(MVP\)

thinktwice said:
//file 1.bat
@call file3.bat

//file 2.bat
@call file1.bat
@call file3.bat

//file3.bat
if variable_a has been defined (goto eof ) else (define variable_a)

i don't want to run the same batch file more than once.

if defined variable_a echo the value of variable_a is %variable_a%
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top