Try using the delayed extension when testing delBuild
:
setlocal enableextensions enabledelayedexpansion IF EXIST TH_BUILD_* ( ECHO A current build of Test Harness exists. set /p delBuild=Delete preexisting build [y/n]?: if "!delBuild!"=="y" ( GOTO deleteandcontinue ) else ( exit ) ) :deleteandcontinue @echo At deleteandcontinue
%var%
variables expand when reading a command. The set of commands between parens is considered as one command, so delBuild
does not exist when you move on to testing. When the extension is delayed, the variables expand when the command is executed, therefore, during the test, delBuild
matters.
Patrick Cuff May 27 '09 at 16:33 2009-05-27 16:33
source share