hi there
need your help guys
i want to delete folder in subdirectory that starting with number only
e.g 00,01,2,000
thank you
zack
delete folder starting with number
Moderator: DosItHelp
Re: delete folder starting with number
Try something like that:
Change the path behind the PUSHD command and run the code to show what would happen.
If youre sure the code would delete the right folders then remove the ECHO command and run it again ...
Regards
aGerman
Code: Select all
@echo off &setlocal
pushd "C:\your\directory" ||goto :eof
for /f "delims=" %%a in ('dir /ad /b /s ^|findstr /rc:"\\[0-9]"') do ECHO rd /s /q "%%~a"
popd
pause
Change the path behind the PUSHD command and run the code to show what would happen.
If youre sure the code would delete the right folders then remove the ECHO command and run it again ...
Regards
aGerman
Re: delete folder starting with number
thank e german,
for woriking script..
for woriking script..