tags:

views:

37

answers:

2

I have this little batch script:

SET @var = "GREG"
ECHO %@var%
PAUSE

When I run it, it prints:

H:\Dynamics>SET @var = "GREG"

H:\Dynamics>ECHO
ECHO is on.

H:\Dynamics>PAUSE
Press any key to continue . . .

Why won't it print the contents of @var? How do I know if @var is even being set?

+5  A: 

Dont use spaces:

SET @var="GREG"
::instead of SET @var = "GREG"
ECHO %@var%
PAUSE
digitalFresh
Thanks, that did it! It's always the little things...
Greg
+3  A: 

Try the following (not that there should not be a space between the VAR and = and = and GREG

SET VAR=GREG
ECHO %VAR%
PAUSE
Jonathan Stanton