Question:
Script or Batch file for certain subfolder deletion?
Banderes
2013-01-17 07:33:23 UTC
I need to delete certain subfolders (and contents) within a folder.
Ie i have a folder called data and want to delete all subfolders with Temp*.
so temp temp001 temp001.001 etc etc etc

Any ideas?
Three answers:
Ferdinand
2013-01-17 08:06:42 UTC
FOR /f %G in ('dir/b/s/ad temp*') DO RD /S/Q %G



searchanddestroy.cmd:

@echo off

FOR /f %%G in ('dir/b/s/ad %1') DO RD /S/Q %%G



searchanddestroy temp*
?
2013-01-17 16:23:28 UTC
REVISED Answer



I use the free 'Eraser' to scrub files/folders in my Sandboxie web browser folder (64bit Pale Moon). Works fine - just have to remember to set it to 'hide after use' and then use 'Minimize' rather than 'Close' to keep the link on the taskbar after you've done a manual scrub.



http://eraser.heidi.ie/



Though the version that I use is the old Eraser 5.8.7
?
2013-01-17 15:40:06 UTC
Wildcards, it's pretty simple.

To be sure...



cd data

rd temp*.*



that should do it, attention to the source code location and setting the correct relative path.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...