Hey All,
Having read an existing post on stackoverflow and done some reading around on the net. I thought it was time to post my question before I lost too much hair!
I have the following code within a batch file which I double click to run, under Windows XP SP3:
SETLOCAL ENABLEDELAYEDEXPANSION
::Observe variable is not defined
SET test
::Define initial value
SET test = "Two"
::Observe initial value is set
SET test
::Verify if the contents of the variable matches our condition
If "!test!" == "Two" GOTO TWO
::First Place holder
:ONE
::Echo first response
ECHO "One"
::Second Place holder
:TWO
::Echo second response
ECHO "Two"
::Await user input
PAUSE
ENDLOCAL
Basically I am trying to establish if I can navigate through my script using conditionals. It seems apparent that I am getting some issues with variable scope and delayed variable expansion yet I'm a little lost on what I'm doing wrong.
Can anyone point me in the right direction?