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
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
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.
Summary: I needed a batch file that would find all types of files such as *.doc files and copy them up to a network drive without the added file structure. I found out a regular xcopy statement copied the file...
Summary: there is no if/then statement. only an if statement. i would do a little more research on batch files before asking. or maybe just put some more info into question. ...
Summary: I have to watch over a bunch of NT machines with each one having certain files located in different locations. Some have the files in C:\ while others have them in G:\ or Z:\ Instead of doing a bunch...