if statment

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
mor.bas
Posts: 66
Joined: 25 Apr 2012 04:28

if statment

#1 Post by mor.bas » 03 Feb 2013 02:22

I want to write a condition in batch like this:

IF !APP_VERSION! NEQ 6 or not equal 7 then ...

How is the right way to do it?

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: if statment

#2 Post by foxidrive » 03 Feb 2013 03:48

This is an AND

IF !APP_VERSION! NEQ 6 IF !APP_VERSION! NEQ 7 ...

this is an OR

set "flag="
IF !APP_VERSION! NEQ 6 set flag=1
IF !APP_VERSION! NEQ 7 set flag=1
if defined flag ...



Others might have different methods.

Post Reply