Hi,
I was wondering if someone could tell me if you can use "or" or something like it in a batch file.
For example:
if /i _"%var%"=="(something)" OR "(something)" OR "(something)" (do whatever)
Is that an accepted command or is there a command that does the same thing that I could use.
Thanks,
Rileyh
How to use "or" in a batch script
Moderator: DosItHelp
Re: How to use "or" in a batch script
'
Code: Select all
@echo off &SetLocal EnableDelayedExpansion
set /a $error = 1
::
if 1 equ 0 (
::
set /a $error = 0
) else if 2 equ 0 (
::
set /a $error = 0
) else if 0 equ 0 (
::
set /a $error = 0
)
::
if !$error! equ 0 (
::
echo. 1 equ 0 OR 2 equ 0 OR 0 equ 0 : do whatever:^)
)
EndLocal
pause
exit /b 0