If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
bug in XP cmd shell
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" @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. |
Ads |
#2
|
|||
|
|||
bug in XP cmd shell
On Dec 23, 1:32*pm, Jim Michaels wrote:
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" @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" @echo If you see this, it worked ) the ! causes delayed expansion at execution. apparently delayed expansion is not enabled by default... |
#3
|
|||
|
|||
bug in XP cmd shell
"Jim Michaels" wrote: 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" @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. "Jim Michaels" wrote: oops. that example should be set VAR=before if "%VAR%" == "before" ( set VAR=after if "!VAR!" == "after" @echo If you see this, it worked ) the ! causes delayed expansion at execution. apparently delayed expansion is not enabled by default... Jim, Did you enable delayed environment variable expansion via CMD /vn |
Thread Tools | |
Display Modes | |
|
|