2024年5月11日发(作者:)
批处理命令
1. Echo [{on|off}] [message]打开或关闭回显功能
2. @不显示命令行本身
3. Call调用子批处理
4. Pause显示”press any key to continue…”
5. Rem [comment] 注释
6. Goto label 跳转到标签
7. If [not] errorlevel Number Command [else Expression]
If [not] String1=String2 Command [else Expression]
If [not] exist FileName Command [else Expression]
8. Choice
/c choices 指定用户选项键,逗号分隔, 默认[Y,N]
/n 隐藏用户选项键
/cs区分大小写
/t timeout /d Choice 超时后默认选项
9. For{%Variable|%%variable}
[CommandLineOptions]
10. Setlocal启动批处理文件中环境变量的本地化
Enableextension
Disableextension
Enabledelayedexpansion
Disabledelayedexpansion
in (set) do Command
批处理应用
一、 参数:
0% 批处理文件名替换
1%-9% 命令行输入的相应参数替换
二、 筛选器:
1. More
2. Find
3. 重定向操作符
重定向输入<
重定向输出>
附加输出>>
管道操作符 |提取一个命令的输出
发布评论