| @echo off echo 正在扫描文件。。。 for /f "delims=" %%a in ('dir /a-d /s /b .picasaoriginals') do ( if /i "%%~nxa"==".picasaoriginals" ( if exist "%%~a" ( echo del /f /q "%%~a">>DelNow.bat ) ) ) if exist "DelNow.bat" ( ping 0 -n "2">nul call:qd ) del /f /q DelNow.bat exit :qd cls set /p q=确认删除吗?(输入Y确定,其它退出): cls if /i "%q%"=="Y" ( echo 正在删除中。。。 ping 0 -n "2">nul call DelNow.bat cls echo 删除完成! ping 0 -n "2">nul ) goto :eof |
示例三:
批量删除电脑中所有带qqq的文件和文件夹
| @echo off echo....文件查找,请等待... c: for /r c: %%a in (.) do @if exist %%aqqq.* del %%aqqq.* for /r c: %%a in (.) do @if exist %%aqqq rd /s /q %%aqqq d: for /r d: %%a in (.) do @if exist %%aqqq.* del %%aqqq.* for /r d: %%a in (.) do @if exist %%aqqq rd /s /q %%aqqq e: for /r e: %%a in (.) do @if exist %%aqqq.* del %%aqqq.* for /r e: %%a in (.) do @if exist %%aqqq rd /s /q %%aqqq f: for /r f: %%a in (.) do @if exist %%aqqq.* del %%aqqq.* for /r f: %%a in (.) do @if exist %%aqqq rd /s /q %%aqqq goto end :end echo good bye! |









