Use "RD /s" instead of deleting files individually

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
angussf
Junior Member
Junior Member
Posts: 16
Joined: 2006-03-01, 21:31 UTC

Use "RD /s" instead of deleting files individually

Post by *angussf »

When you delete an entire directory, Total Commander deletes each file individually. This can cause problems if there are infected files in the directory as your real-time virus-shield will prevent the file from being deleted as TC opens the file to delete it. At least that's what happened to me today when I was cleaning up a directory that had some trojans in it.

I was able to open a CMD prompt (Windows XP Pro SP2), CD to the parent, and then use "RD /S infected-directory" to delete the entire tree with no problemsso this tells me the files were only locked when TC tried to delete them. If TC could use the "RD/q/s" logic instead of using whatever it does now, especially when you press [Shift-Del] to delete-bypassing-the-recycle-bin, this IMHO would be a Good Thing.
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

You can use the Explorer method for deleting, I dont know if that is sufficient. Just select Delete from the context menu of the folder.
This can cause problems if there are infected files in the directory
Infected files can cause many more problems than that ;-) I dont think you should play around with TC if you have an infection. Use a decent Live CD instead like Knoppix.
I switched to Linux, bye and thanks for all the fish!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I don't see how RD could delete an entire tree without deleting all files individually. If it just removed the link to the directory, then the disk space allocated for the files would remain allocated, resulting in lost chains (which only scandisk/checkdisk could free)...

Therefore I can just guess that your virus scanner is actively ignoring the RD command to make it faster...
Author of Total Commander
https://www.ghisler.com
angussf
Junior Member
Junior Member
Posts: 16
Joined: 2006-03-01, 21:31 UTC

Post by *angussf »

ghisler(Author) wrote:I don't see how RD could delete an entire tree without deleting all files individually. If it just removed the link to the directory, then the disk space allocated for the files would remain allocated, resulting in lost chains (which only scandisk/checkdisk could free)...

Therefore I can just guess that your virus scanner is actively ignoring the RD command to make it faster...
It is my understanding that what RD does is to recursively process its way through the FAT (or NTFS) freeing up the occupied sectors without opening the files. It doesn't leave any orphaned allocated chains.

Microsoft Windows XP - Rmdir (rd)
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/rmdir.mspx

Apparently TC must open the files to delete them or my AV wouldn't yap.
Post Reply