- @echo off
- rem 批处理保存为ansi编码格式
- echo %cd%
- for /d %%d in (*) do (
- pushd "%%d"
- for /f "delims=" %%i in ('dir /b /ad ^|findstr /vx /c:"小明A" /c:"小明B" /c:"小明C"') do (
- if "%1" equ "rem" (
- rd /s /q "%%i"
- ) else (
- echo rd /s /q "%%i"
- )
- )
- popd
- )
- %1 echo 按任意键确认删除 & pause
- %1 %0 rem
- exit
复制代码
使用前先测试!请谨慎使用! |