1.统计文件中指定字符串个数:
find /c "aiss" C:\Users\18430\Desktop\test\a.txt
2.for循环
根目录下 for /l %a in (1,1,10) do gpupdate/force && shutdown -r
3.for循环创建文件夹
for /l %%a in (1,2,10) do md %%a
4.执行完可执行程序后自动关闭窗口
start exemple.exe exit
5.文件重命名
cd filePath
ren a.txt b.txt
6.递归删除文件
del *.doc /f /s /q /a
7.递归修改文件扩展名、
cd C:\Users\18430\Desktop\java\
for /r %a in (*.txt) do ren %a *.doc
8.读取文件,跳过前五行,输出第五个词
for /f "skip=5 tokens=5" %a in (todel.txt) do %a echo %a
9.读取文件,输出文件所有内容
for /f "tokens=*" %a in (a.txt) do echo %a
原文:https://www.cnblogs.com/yanweichen/p/10520186.html