batch file with flags code example
Example 1: batch file with flags
:processargs
SET ARG=%1
IF DEFINED ARG (
IF "%ARG%"=="/r" ECHO You passed the /r flag.
SHIFT
GOTO processargs
)
Example 2: batch file with flags
FOR %%A IN (%*) DO (
IF "%%A"=="/r" ECHO You passed the /r flag.
)