1.

Solve : An all deleting thing..?

Answer»

Hey, i'm looking for something to delete every single file of a the "log" extension, in every PATH and on every HDD..

I've seen this somewhere before a long time ago, though this was considerd a virus ..

Any idea's ?
Well, this will delete all log files on your c: drive
for /f %a in ('dir /s/b c:\*.log') do del %a

I will leave you to work out how to iterate through all your drives
GrahamHehe Thanks i'll look into that.. (no idea how yet)Hmm well when i tryd to printscreen quick before it closes with even the pause command in it ..,
I get this:



Any help would be appreciated.You want to delete all MP3 files?

Anyway, you are missing some characters in your statement. If you are REALLY sure you want to delete all MP3 files on your C: drive, the syntax for the command line (slightly modified version of gpl's code) would be:
Code: [Select]for /f "delims=" %a in ('dir /a /s /b C:\*.mp3') do del "%a"For your X: drive, it would be:
Code: [Select]for /f "delims=" %a in ('dir /a /s /b X:\*.mp3') do del "%a"If you are executing the command from a batch file, you need to double up on your %
To automatically run on all local drives, provide your OS and I'll provide the code.Hey yea i tested it with some mp3 on a new partion to see if it worked,
Im using Windows XP

And for the missing character well yea.. i put it in right but the output was just weirdSo it is working now?Hmm it atleast ran yea, though it sayd access denied on each file, and yea im running it from a batchWhat happens if you try to delete one of the same files manually from the command line? I assume you get the same error?

Assuming that you do get the same permission denied error, see if it is an NTFS permission (file properties -> security tab) issue, or a file attribute issue (read only), or something else.

Once we have that problem figured out, you can either fix it from the OS, or we can ADD code to your statement to work around the issue in your script.I'm sorry to have made you post again, i dont know what i did but i did it, it works
Thanks a lot for the help !

only thing LEFT now is every drive



Discussion

No Comment Found