Hy
I've two conditions cond1 and cond2 , if both conditions are true do command1 if someone is false do command2.
is any chance to introduce these two conditions in "if" command using logical operators
for now use this solution, but seems too long .....
if cond1 (
if cond2 (
command1) else (
command2)
) else command2
IF command use logical operators....
Moderator: DosItHelp
Re: IF command use logical operators....
No, there are no logical operators.
You could use something like this forlogical AND
and this for logical OR
Regards
aGerman
You could use something like this forlogical AND
Code: Select all
set /a n=0
if cond1 set /a n+=1
if cond2 set /a n+=1
if cond3 set /a n+=1
if %n%==3 (command1) else command2
and this for logical OR
Code: Select all
set /a n=0
if cond1 set /a n+=1
if cond2 set /a n+=1
if cond3 set /a n+=1
if %n% gtr 0 (command1) else command2
Regards
aGerman
Re: IF command use logical operators....
nice catch
thank you very much.
thank you very much.