I have many bat files that share a common setup of variables. Instead of defining the same variables over and over again (and making errors in the process) I would like to include one bat file in all the others.

How do I do this? Excuse my newbie question but the last time I touched bat, it was a file called autoexec.bat, long ago...

Thanks!

link|improve this question

67% accept rate
feedback

1 Answer

up vote 5 down vote accepted

You can call another bat file with "call FILENAME". Don't really know if that is sufficient for you.

link|improve this answer
Thanks! Easy as that... – raoulsson Aug 26 '09 at 13:12
sometimes it is just that :) – StampedeXV Aug 26 '09 at 13:19
1  
Do variables exist to the new batch file? I think you'll need to pass them to the environment with the SET Command. – BillN Aug 26 '09 at 14:45
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.