IF [/I]
item1 compare-op item2 command
IF [/I]
item1 compare-op item2 (
command) ELSE (
command)
Error Check Syntax
IF [NOT] DEFINED
variable command
IF [NOT]
ERRORLEVEL
number command
IF CMDEXTVERSION
number command
key
item May be a text string
or an environment variable
a variable may be modified using either
Substring syntax
or
Search syntax
command The command to perform
NOT perform the command if the condition is false.
== perform the command if the two strings are equal.
/I Do a case Insensitive string comparison.
compare-op May be one of
EQU :
Equal
NEQ : Not equal
LSS : Less than <
LEQ :
Less than or Equal <=
GTR : Greater than >
GEQ : Greater than or equal >=
This 3 digit syntax is necessary because the > and <
symbols are recognised as redirection operators
IF ERRORLEVEL
n
statements should be read as IF
Errorlevel
>=
number
i.e.
IF ERRORLEVEL 0 will return TRUE when the errorlevel is 64
You see things; and you say 'Why?' But I dream things that never were; and I say 'why not?' ~
George Bernard Shaw
IFMEMBER
(
Resource Kit
)
Find out if the current user is a member of one or more workgroups.
Syntax
IFMEMBER [
options]
WorkGroup [
WorkGroup2 WorkGroup3...]
Options:
/verbose or /v : print all matches.
/list or /l : print all groups user is a member of
The %ERRORLEVEL% return code shows how many of the listed workgroups the currently
logged-in user is a member of.
Chia sẻ với bạn bè của bạn: