Computing.Net > Forums > Windows 2000 > multiple conditions batch script

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.

multiple conditions batch script

Reply to Message Icon

Name: taiwf
Date: September 25, 2005 at 16:54:37 Pacific
OS: win2k
CPU/Ram: p4 celeron/512Mb
Comment:

Can anyone tell me is there a way to do sth like :
----------
If (condition A ture) and (condition B ture) and ...
( echo "multiple conditions filtering work"
)

----------------------
ps : i know i can use neted if clause. But that might make debugging harder....

Thank in advance
david



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: September 26, 2005 at 04:37:01 Pacific
Reply:

if %xxx%'==' if %zzz%'==' echo both true


If at first you don't succeed, you're about average.

M2


0

Response Number 2
Name: taiwf
Date: September 27, 2005 at 19:27:04 Pacific
Reply:

I do a little test, but it doesn't seem to work. Can you explain a bit your syntax?
Thx !
-----

set xxx=1
set zzz=1
if %xxx%'==' if %zzz%'==' echo both true

set xxx=
set zzz=


0

Response Number 3
Name: Mechanix2Go
Date: September 28, 2005 at 00:05:52 Pacific
Reply:

Hi david,

If zzz is not set, this will be true:

%zzz%'=='

because it will resolve to:

'=='

###
Try this modification to your code:

::::::::::::::::::
@echo off

set xxx=1
set zzz=1
if %xxx%'==1' if %zzz%'==1' echo both true

set xxx=
set zzz=

if %xxx%'==' if %zzz%'==' echo both true
::::::::::::::::::::::::



If at first you don't succeed, you're about average.

M2


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Windows 2000 Forum Home


Sponsored links

Ads by Google


Results for: multiple conditions batch script

pass values between batch scripts www.computing.net/answers/windows-2000/pass-values-between-batch-scripts/60580.html

Need help with Batch script. www.computing.net/answers/windows-2000/need-help-with-batch-script/50848.html

Batch Script... www.computing.net/answers/windows-2000/batch-script/43991.html