On Dec 23, 1:32 pm, Jim Michaels <jmich...[ at ]yahoo.com> wrote:
[Quoted Text] > in the cmd shell help (from cmd shell do set /?), it gives the example > > set VAR=before > if "%VAR%" == "before" ( > set VAR=after > if "%VAR%" == "after" [ at ]echo If you see this, it worked > ) > > the "if you see this, it worked" never shows. > I am using XP Pro SP3 32-bit on an HT processor that thinks it's a > dual-core.
oops. that example should be
set VAR=before if "%VAR%" == "before" ( set VAR=after if "!VAR!" == "after" [ at ]echo If you see this, it worked )
the ! causes delayed expansion at execution.
apparently delayed expansion is not enabled by default...
|