Pregunta

I am trying to create a DOS batch file that will delete all folders starting with the number 20 using the following command: "del /Q ".

I am running this on a Windows 2000 Pro PC.

¿Fue útil?

Solución

for /f "delims=" %%d in  ('dir /ad /b ^| findstr /i /b "20"') do rd /s  /q "%%~dpfnd"

Otros consejos

This seems to work.

@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
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top