I read and tried some code from
What's the fastest way to delete a large folder in Windows? (rmdir /s /q folder
)
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.
From Explorer To delete matching files: enter *_bad. jpg in the search box, select the results and press Delete or Del.
To remove a directory that is not empty, use the rm command with the -r option for recursive deletion. Be very careful with this command, because using the rm -r command will delete not only everything in the named directory, but also everything in its subdirectories.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With