R Saudlach
R Saudlach

Reputation: 388

Remove Folders in command line With Wild Cards

I have a Windows 2003 Server and need to remove all folder through command line that start with people.

I tried rmdir people* and rd people* but those command don't seem to accept wildcards

Is there any simple command to do this without use for looks to find all folder and delete them?

Upvotes: 2

Views: 3621

Answers (1)

Alex K.
Alex K.

Reputation: 175986

Use the FOR construct with /d to limit to directories;

for /d %n in (c:\blah\people*) do @echo "%n"

replacing @echo with rd once you've tested.

Upvotes: 3

Related Questions