Batch file DOS:删除以开头的文件夹
我正在尝试创建一个DOS批处理文件,该文件将使用以下命令删除从数字20开始的所有文件夹:“del/Q” 我正在Windows 2000 Pro PC上运行此功能。此功能似乎有效Batch file DOS:删除以开头的文件夹,batch-file,file-io,dos,batch-processing,Batch File,File Io,Dos,Batch Processing,我正在尝试创建一个DOS批处理文件,该文件将使用以下命令删除从数字20开始的所有文件夹:“del/Q” 我正在Windows 2000 Pro PC上运行此功能。此功能似乎有效 @echo off &setlocal pushd "C:\your\directory" ||goto :eof for /f "delims=" %%a in ('dir /ad /b /s ^|findstr /rc:"\\[20]"') do rd /s /q "%%~a" popd pause 作品非
@echo off &setlocal
pushd "C:\your\directory" ||goto :eof
for /f "delims=" %%a in ('dir /ad /b /s ^|findstr /rc:"\\[20]"') do rd /s /q "%%~a"
popd
pause
作品非常感谢你!!
for /f "delims=" %%d in ('dir /ad /b ^| findstr /i /b "20"') do rd /s /q "%%~dpfnd"