Quote from MS Tech­net:

Q: Hey, Script­ing Guy! How can I delete fold­ers based on a wild­card char­ac­ter? For exam­ple, how can I delete all the fold­ers whose name starts with December?

A: Hey, RR. Well, that depends. If you’re run­ning Win­dows XP or Win­dows Server 2003, you can actu­ally use a wild­card char­ac­ter to iden­tify and then delete all the fold­ers whose name starts with Decem­ber. If you’re run­ning Win­dows 2000, you can achieve the same net result: you can iden­tify and delete all the fold­ers whose name starts with Decem­ber. It’s just that you’ll have to do it in a more clumsy, brute-force fashion.

The Script­ing Guy pro­vides a .vbs script to enhance the Win­dow 2000 del.exe and rd.exe com­mand and sup­port wild­cards. Here is a 1-line shell script:

rdw.cmd (you could add /q to run the script quite):

1
2
echo delete direc­tory %1
for /f “tokens=*” %%i in (‘dir %1 /b’) do rd “%%i” /s

Exam­ple:

1
rdw.cmd “c:program filesa*”

This should be eas­ier to use..