Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows XP » microsoft.public.windowsxp.basics
Thread: bug in XP cmd shell

HTVi
TV Discussion Newsgroups

bug in XP cmd shell
Jim Michaels <jmichae3[ at ]yahoo.com> 12/23/2008 9:32:28 PM
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.

Re: bug in XP cmd shell
Jim Michaels <jmichae3[ at ]yahoo.com> 12/23/2008 9:37:51 PM
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...
Re: bug in XP cmd shell
"a_nonymous" <anonymous[ at ]discussions.microsoft.com> 12/24/2008 3:24:53 AM

"Jim Michaels" 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.

"Jim Michaels" wrote:
> 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...

Jim,
Did you enable delayed environment variable expansion via
CMD /v:on


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen