delayedvariableexpansion

Windows Batch File - ENABLEDELAYEDEXPANSION query

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 t...

Batch delayed expansion not working.

Ok, I'm getting crazy and I don't know what else to do, I've tried several things and nothing is working. Look at this sample code (test.cmd): setlocal enabledelayedexpansion enableextensions set VAR=before if "%VAR%" == "before" ( set VAR=after; if "%VAR%" == "after" @echo If you see this, it worked ) This is the generated o...