Nick Hodges

Blegging for an Old-School DOS command

01 Sep

All right, time to break out the old-school DOS knowledge from way back. Anyone know how to make this command:

for /d %%a in ("%ALLUSERSPROFILE%Application Data{*") do rd /s /q "%%a"

find (and then, of course, delete) hidden directories?

3 Responses to “Blegging for an Old-School DOS command”

  1. 1
    Sebastian Zierer Says:

    How about:

    for /F "usebackq" %%i IN (`dir /b /a:hd "%ALLUSERSPROFILE%\Application Data\{*"`) DO @rd /s /q "%ALLUSERSPROFILE%\Application Data\%%i"

  2. 2
    Nick Hodges Says:

    Yes! That worked! Thanks, Sebasitan!

    Nick

  3. 3
    Keld Hansen Says:

    Or even easier - if you run 4NT as command processor - :

    for /a:d /h %x in (<mask>) do <command>

Leave a Reply

© 2008 Nick Hodges | Entries (RSS) and Comments (RSS)

Your Index Web Directorywordpress logo
Close