Description: In the F:\Download folder, there are subfolders 1, 2, 3, 4, 5. The problem is to keep subfolders 1 and 2 and delete the remaining three folders. Use the following program. But it only keeps folder 1 and deletes the others.
for /f "skip=1 tokens=*" %%i in ('dir F:\Download\ /b /ad ^|find /v "F:\Download\1,2"') DO rd /s /q "F:\Download\%%i"
del F:\Download\*.* /a/q/f
Everyone, please help see how to modify the above program to achieve the purpose of keeping subfolders 1 and 2!
Thank you in advance!
[ Last edited by nbic on 2007-6-1 at 07:32 PM ]
for /f "skip=1 tokens=*" %%i in ('dir F:\Download\ /b /ad ^|find /v "F:\Download\1,2"') DO rd /s /q "F:\Download\%%i"
del F:\Download\*.* /a/q/f
Everyone, please help see how to modify the above program to achieve the purpose of keeping subfolders 1 and 2!
Thank you in advance!
[ Last edited by nbic on 2007-6-1 at 07:32 PM ]
