<p>I have a folder "FolderA" which contains three sub-folders: foldera1 foldera2 and foldera3</p>

<p>I need to write a batch file which resides inside "FolderA". It should delete all the folders under "FolderA" as a cleanup activity. I don't know the folder names. <code>rmdir</code> does not support wild cards.</p>

<p>Could someone provide a solution for this small problem?</p>

something like :
```
```
for /f %%a in ('dir /ad /b') do (rmdir /S /Q "%%a")
for /d %%a in (*) do (rmdir /S /Q "%%a")
```
```
should do the trick. The second form allow some wildcard selection for directories.
To test it outside a script, in a plain DOS session:
```
```
for /f %a in ('dir /ad /b') do (rmdir /S /Q "%a")
for /d %a in (*) do (rmdir /S /Q "%a")
```
```
Note the
double quotes
, in order to be able to delete directories with spaces in them.