Categories
Operating systems

Windows 7 empty recycle bin “hanging” with a lot of files

I was just cleaning up a directory path and had over 1GB and several thousand files in my recycle bin. About 5 minutes after selecting “Empty Recycle Bin” I still hadn’t even got as far as the prompt asking to confirm the delete. After some system monitoring I saw that Microsoft Security Essentials was attempting to scan the files. After temporarily disabling real-time protection the prompt immediately appeared and the bin emptied within 10 seconds or so.

Rather interesting that they scan files that are about to be deleted. The .NET FileSystemWatcher has a deleted method as does the underlying Win32 API so it’s not hard to detect.