I want to use windows command line to remove all files and directories except one, the folder ".svn". I tried doing it like this, in two steps (my working directory is the folder that I want to clean):
- First remove all directories with the exception of ".svn":
dir /B /A:D | findstr /V ".svn" | rmdir /Q
- Remove all files:
del * /F /Q
Step 2 is OK, but for step 1 I get an "The syntax of the command is incorrect." error. Thrown by the rmdir
cmd. Does anybody know how to do this OK: delete all directories except one.