首页 > Linux操作系统 > Linux操作系统 > dos批处理命令小记
1 判断操作系统
if "%OS%" == "Windows_NT" goto WinNT
:WinNT
......
2 判断第一个参数是否为空,并赋值
@set args=
if "%1"=="" goto arg_end
set args=%1
3 变量的使用
if "%args%"=="" goto with_no_args
4 loop的使用
:loop
shift
if "%1"=="" goto arg_end
set args=%args% %1
goto loop
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/271063/viewspace-968983/ ,如需转载,请注明出处,否则将追究法律责任。