Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Re: If syntax for numeric values

Reply
Thread Tools Display Modes

Re: If syntax for numeric values

 
 
Pegasus
Guest
Posts: n/a

 
      03-10-2009

"Alan" <> wrote in message
news:592f12fa-df6f-402b-8622-...
> Hi. I have a bonehead question. I'm just trying to do a simple
> cmd script using an IF statement. Why doesn't the code below work?
>
> Thanks, Alan
>
> set retry = 0
>
> if retry = 0 echo Hello


Try this:

@echo off
set retry=0
if retry==0 echo Hello

Note the absence of spaces around the = and the doubling of the = symbol.


 
Reply With Quote
 
 
 
 
Al Dunbar
Guest
Posts: n/a

 
      03-10-2009

"Pegasus" <> wrote in message
news:...
>
> "Alan" <> wrote in message
> news:592f12fa-df6f-402b-8622-...
>> Hi. I have a bonehead question. I'm just trying to do a simple
>> cmd script using an IF statement. Why doesn't the code below work?
>>
>> Thanks, Alan
>>
>> set retry = 0
>>
>> if retry = 0 echo Hello

>
> Try this:
>
> @echo off
> set retry=0
> if retry==0 echo Hello
>
> Note the absence of spaces around the = and the doubling of the = symbol.


Or try this:

@echo off
set/a retry = 0
if "%retry%" EQU "0" echo/Hello

/Al


 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NSlookup for Numeric Node name R.J.H. DNS Server 2 10-04-2007 06:56 PM
Numeric Keypad BobP Windows Vista Hardware 0 04-09-2007 01:40 PM
bug in WMP version 11 - DRM values show incorrect values Ollie Riches Windows Media Player 4 04-05-2007 10:38 PM
No numeric usernames? Thomas Hacker Windows Vista Administration 0 06-29-2006 07:13 AM
numeric keypad mycra Virtual PC 0 06-30-2005 01:51 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59