I am trying to delete from a folder all the folders that have a specific name like this
for /f "delims=" %%i in ('dir /b /ad /s CVS*') do rmdir /s /q %%i
The problem is that if the command 'dir /b /ad /s CVS*' returns the 'File Not Found' and the 'for' command will iterate over all the folders in my directory
Is there a way to make the command work in both cases: when folders exist and when they don't