goback add

分析dos下删除所有的exe文件(包含子目录)

3028 点击·0 回帖
灯火互联
楼主

DOS下删除所有的exe文件,包含子目录



删除c:盘 上全部exe 文件。呵呵。不要乱用啊!



可以用 dir /b /s /a-d *.exe 配合 awk 自动生成一个脚本,然后运行这个脚本删除*.exe

dir /b /s /a-d c:*.exe|awk '{print "del "$0}'>delx.bat

call delx.bat  


也可以 找出全部子目录传递给 awk 生成一个删除这些子目录中包含的exe 文件的脚本,然后调用这个脚本。

dir /b /s /ad c:|awk '{print "del "$0"*.exe"}' >delx.bat

call delx.bat






喜欢0 评分0