if "%1"=="" goto Sa
if "%1"=="/" goto :DSa
if "%1"=="?" goto :DSa
if "%1"=="/?" goto :DSa
if "%1"=="-h" goto :DSa
if "%1"=="/h" goto :DSa
:DSa
ECHO.yes
pause>nul
#################
下面这个是我参照其它例子改的,为方便测试加入数字:
@ECHO off
:: =========================
:: 参数1
if ""=="%1" goto enda
if "%1"=="/" goto DSa
if "%1"=="?" goto DSa
if "%1"=="/?" goto DSa
if "%1"=="-h" goto DSa
if "%1"=="/h" goto DSa
if "%1"=="b" goto BSa
if "%1"=="-b" goto BSa
if "%1"=="/b" goto BSa
if "%1"=="-d" goto DS2a
if "%1"=="/d" goto DS2a
If not ""=="%1" goto NONO1
goto enda
:DSa
ECHO.帮助参数 1
pause>nul
goto enda
:BSa
ECHO.备份参数 1
pause>nul
goto enda
:DS2a
ECHO.清空参数 1
pause>nul
goto enda
:NONO1
set err="%1"
echo.没有 %err% 这个参数! 1
pause>nul
:enda
:: =========================
:: 参数2
if ""=="%2" goto endb
if "%2"=="/" goto DSb
if "%2"=="?" goto DSb
if "%2"=="/?" goto DSb
if "%2"=="-h" goto DSb
if "%2"=="/h" goto DSb
if "%2"=="-b" goto BSb
if "%2"=="/b" goto BSb
if "%2"=="-d" goto DS2b
if "%2"=="/d" goto DS2b
If not ""=="%2" goto NONO2
goto endb
:DSb
ECHO.帮助参数 2
pause>nul
goto endb
:BSb
ECHO.备份参数 2
pause>nul
goto endb
:DS2b
ECHO.清空参数 2
pause>nul
goto endb
:NONO2
set err="%2"
echo.没有 %err% 这个参数! 2
pause>nul
:endb
:: =========================
:: 参数3
if ""=="%3" goto endc
if "%3"=="/" goto DSc
if "%3"=="?" goto DSc
if "%3"=="/?" goto DSc
if "%3"=="-h" goto DSc
if "%3"=="/h" goto DSc
if "%3"=="-b" goto BSc
if "%3"=="/b" goto BSc
if "%3"=="-d" goto D3Sc
if "%3"=="/d" goto D3Sc
If not ""=="%3" goto NONO3
goto endc
:DSc
ECHO.帮助参数 3
pause>nul
goto endc
:BSc
ECHO.备份参数 3
pause>nul
goto endc
:D3Sc
ECHO.清空参数 3
pause>nul
goto endc
:NONO3
set err="%3"
echo.没有 %err% 这个参数! 3
pause>nul