Solved del folder from all drives and from sub folders

Acer / 4630
September 22, 2012 at 14:43:57
Specs: Windows XP, 1 gb
I want to create a batch file that needs to scan all my drives for folder abc and deleate it

See More: del folder from all drives and from sub folders

Report •

September 22, 2012 at 21:08:16
✔ Best Answer
@echo off
set echo=echo
:: enable foll line to REMOVE safety
:: set echo=
:: ECHO ECHo ECho Echo echo...
if %echo% equ echo (echo safety is ON) else (echo CAUTION safety is OFF)
for %%a in (c d e) do (
echo scanning drive %%a:
for /f "tokens=*" %%z in ('dir /b /s /a:d %%a:abc') do %echo% rd /s /q %%z
::=== end

NOT tested!, therefore:
safety is ON due to the nature of the beast. remove the "echo" if/when you feel brave and confident, which will then unleash the fury of RD /S /Q!!! Not done lightly.

"(c d e)" is just an example, replace with drive letters as appropriate to your needs.
If you want complete automation, maybe use fsutil or vbscript to enumerate drives and their types.

Report •
Related Solutions

Ask Question