|
下面的批处理用于自动删除AAA和BBB
- @echo off
- rem 将需要处理的文件拖到批处理图标上,或者将批处理的快捷方式放到发送到文件夹(运行shell:sendto)
- echo 处理中...
- rem 设置输出文件为原目录下 原文件名_修改_当前时间
- set "outfile=%~dp1%~n1_修改_%time:~0,2%%time:~3,2%%time:~6,2%%~x1"
- color>"%outfile%"
- for /f "delims=" %%A in ('findstr /n .* "%~f1"') do (
- set "var=%%A"
- setlocal enabledelayedexpansion
- set var=!var:AAA=!
- set var=!var:BBB=!
- set var=!var:*:=!
- (echo;!var!)>>"%outfile%"
- endlocal
- )
- explorer /select,"%outfile%"
- echo;
- echo:
- echo/
- color 2f
- echo 搞定!
- ping 127.1 -n 3 >nul 2>nul
- exit
复制代码 |
|