Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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!

share|improve this question

1 Answer 1

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.

share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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