Click to See Complete Forum and Search --> : Using a wildcard for directories in a batch file?


talon39
January 8th, 2005, 06:03 PM
I'm trying to create a batch file for use in Windows XP that will Delete all directories that start with XA. I tried the following:

RD /s /q XA*

I get the following error:

The filename, directoryname, or volume label syntax is incorrect.

I think that I just dont know how to correctly use a wildcard with directories in an Xp enviroment. Can anyone help me?

Thanks

visualAd
January 8th, 2005, 06:22 PM
The rd command doesn't take wildcards, but the FOR construct does: :p

FOR /D %d IN (XA*) DO RD /S /Q %d

talon39
January 8th, 2005, 07:27 PM
Thanks