for loop - Unable to delete hidden files using FOR command -
i trying put command delete hidden , non-hidden .tmp files under sub-directories deep file structure using 8.3 short file names.
i have been experimenting simple test directory called c:\dl\test1234567890
using following command:
for /r c:\dl\test1234567890 %q in (*.tmp) del /a "%sfq"
i hoping /a
delete hidden , non-hidden .tmp files seems delete non-hidden files. hidden files remain. there better way of doing this?
attrib /s -h "d:\wherever\whatever\*.tmp" del /s "d:\wherever\whatever\*.tmp"
the first command un-hides files, second delets them (use extreme caution)
you may want add -s
, possibly -r
list of switches in attrib
command (remove "system" , "read-only" attributes)
Comments
Post a Comment