6

I read and tried some code from

  1. What's the fastest way to delete a large folder in Windows? (rmdir /s /q folder)

  2. Delete Files with Windows Command Prompt

I want to create a batch which delete a folder which name starts with Test_. I have a folder D:\Test_123_19_10_2012.

How to write in batch or command prompt ? Need regular expression ?

Thank you for patience.

Community
  • 1
  • 1
Snake Eyes
  • 15,519
  • 32
  • 105
  • 203

1 Answers1

12

Here you go

for /d %%a in (D:\Test_*) do rd %%a /q

The for loop is necessary as it seems rd doesn't support wildcards.

Bali C
  • 29,317
  • 35
  • 118
  • 150