Computing.Net > Forums > Disk Operating System > if then statements

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

if then statements

Reply to Message Icon

Name: Chris
Date: January 23, 2002 at 10:11:36 Pacific
Comment:

I would like to write a statement like below but I don't know the proper syntax. I want the output so that if a variable equals a certain value then a value is inputted for another variable.

If %5=yes maybe then %6=finished
If %5=no then %6=try again



Sponsored Link
Ads by Google

Response Number 1
Name: pyr8
Date: January 24, 2002 at 03:17:13 Pacific
Reply:

if %5 = yes ( this assumes that the 5th tag after %0 is a yes ) then %6 = finished ( incorecct ... you would instead nned another variable to work within the batch file by another name or you are renaming variables designed to be defined outside of the fule ) so try
if %5=yes then set %no6=finished
if %5=no then %no6 try_again
call whatever.bat %no1 %no2 %no3 %no4 %no5 %no6


However I could be more specific to the problem if you tell me more specifically what you wish to do with the batch file.



0
Reply to Message Icon

Related Posts

See More


Dos program problem PCMCIA serial port and DO...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: if then statements

if exist statement www.computing.net/answers/dos/if-exist-statement/13424.html

bat file to del file after date www.computing.net/answers/dos/bat-file-to-del-file-after-date/13958.html

Search for a dir, then use as a var www.computing.net/answers/dos/search-for-a-dir-then-use-as-a-var/12091.html