I've been having a really strange problem in Windows 7 that's been driving me nuts.
Sometimes when I delete a folder full of random files (and no, not files in the Windows folder) and one of those files is an .exe, the .exe will refuse to delete (which prevents the folder from properly deleting too). Maybe not refuse to delete, but more along the lines of that the .exe disappears when I hit Shift-Del and enter, but if I refresh that folder and/or reopen that folder, the .exe returns, like as though nothing happened. I've tried using utilities like Unlocker to force the OS to let go of the exe file, but Unlocker simply says it'll try to delete the file upon reboot.
Usually when I do run into this, a simple reboot of the OS does the trick (which makes Unlocker doing it on reboot pointless). After I reboot, the OS "lets go" of the exe and allows me to delete it. The problem is, this happens quite often and it drives me absolutely nuts. It prevents certain update utilities that delete an exe and replace it with a new version of the exe from properly working. I've had it screw up my Steam updates a few times where I ended up having to manually force the update through several restarts.
What puzzles me is that there is no rhyme or reason to when the OS refuses to let go of these exe files. They happen on different drives on different folders. My suspicion was Microsoft Security Essentials hanging onto the exe, but even disabling that didn't work, so I'm wondering just what the heck is causing these exes to refuse to delete like that and why restarting the OS allows me to properly delete them. Already did a virus and spyware scan - nothing's in there. This happens with different drives on different SATA controllers and all of them are in good health.
Anyone have any idea what causes this?
Edit: I actually had it happen the other day. Luckily, I had Process Monitor available. It was an exe file. A bit of clarification on what happens when the exe gets "stuck": The exe looks like it deletes, then disappears, but when I close and reopen the folder, it comes back. If at this point, I try to delete it again, it refuses to move and stays in the folder. Shift-Del doesn't work either. Sometimes ithis first part doesn't happen and just immediately refuses to delete.
This time, it was Malwarebytes trying to update itself using the usual update installer wizard. Got a "can't move file" error with it unable to remove mbam.exe. I launched Process Monitor and searched for mbam.exe - showed that explorer.exe for some reason was hanging onto it. I killed off explorer.exe from the Task Manager and restarted it and that did the trick. Windows "let go" of the file and allowed the update process to continue.
Now I understand why a restart fixes this, since obviously this closes Windows Explorer and relaunches it. I bet a logoff would do the trick too. However, this begs the question: what the heck is causing Windows to hang onto these exes?