tags:

views:

43

answers:

1

I've played around quite a bit now, and can't seem to get variables to work in a batch file, when executing commands. So, can anyone tell me if this is possible, and what is wrong with these lines of code:

set THE_DB = myAwesomeDb
set OUTPUT_FILE = .\db\mydb.sql
mysqldump -u root --opt %THE_DB% > %OUTPUT_FILE%
+5  A: 

Don't put spaces around the equal symbol.

set THE_DB=myAwesomeDb
set OUTPUT_FILE=.\db\mydb.sql
mysqldump -u root --opt %THE_DB% > %OUTPUT_FILE%
cedrou
You rock! Thanks. You dont maybe know how make a a seperate file with lots of variables in it, that I can then include into other files?!
RD
Try to put all your set commands in another batch file and call it in your main batch with the call command.
cedrou