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 exe files?

4 Answers 4


I know this is a really old question of mines, but this was driving me absolutely nuts.

After a quick Google search with the right keywords, I was able to figure out that the reason why Explorer was hanging onto my executables was because my Application Experience service was disabled. I must have disabled this a long time ago for whatever reason. After enabling it, deleted EXEs stay deleted and I can now update programs without any problems.

I don't know WHY disabling that service caused this problem to happen, but I'm just glad I don't have to worry about executables getting "stuck" anymore.

Source for solution: http://www.sevenforums.com/general-discussion/227681-problem-locked-exe-files.html

  • 1
    Thanks man, this fixed the problem. I don't know what Microsoft guys think, but that's not the way OS services should work (and should not). :-(
    – Ho1
    Jul 23, 2013 at 0:58
  • 1
    This is utterly unbelievable, some sneaky M$-based spyware must be running in the inner core of the kernel. Feb 24, 2015 at 1:33
  • 1
    I can't express how glad I am I stumbled upon this, and that you posted your answer, we have several servers with several Ring 0 applications, and we were blaming most of them. Turning on that service removed all the locks I had right away. The application experience was disabled by choice, but no GPO was set to properly disable the application compatibility engine and the PCA. I would give you way more than +1 if I could :)
    – jValdron
    Mar 3, 2016 at 13:47
  • 1
    @HenriquedeSousa No spyware, but it does call home. It protects users which doesn't know what they're installing/running from running something that would break their whole system (BSOD on start, etc). It explains everything here: msdn.microsoft.com/en-us/library/aa480152.aspx#appcomp_topic19
    – jValdron
    Mar 3, 2016 at 13:48
  • 2
    @WhitePhoenix GPO location: Computer Configuration -> Administrative Templates -> Windows Components -> Application Compatibility, and then set "Turn Off Program Compatibility Assistant" to "Enabled" Registry location: HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat!DisablePC. See social.technet.microsoft.com/Forums/windows/en-US/…
    – jValdron
    Dec 20, 2017 at 12:19

In Process Explorer, use CTRL+F and type in the name of the executable.

This will identify what is keeping it open, either the executable itself or a virus scanner...

  • As I can't exactly force the problem to happen (as there's no rhyme or reason as to what causes it), I'll download this and keep it handy so I can launch it the next time this happens. My suspicion might still be MSE hanging onto it despite turning off the realtime protection, but I'm not sure. I've checked Task Manager to see if the process was still running when this happened before, but the process/exe is not there. It's just weird - the exe keeps coming back after each deletion attempt; it behaves almost similar to Windows File Protection does for the C:\Windows directory. Sep 22, 2011 at 10:47
  • 2
    @WhitePhoenix: Wait, do you actually see that .exe is gone but returns later? In that case, Process Monitor might come in handy to see what I/O operations are exactly happening... Sep 22, 2011 at 10:48
  • 1
    @WhitePhoenix: If it is Windows File Protection, check your event logs. WFP logs an entry when it fires. support.microsoft.com/kb/222193
    – surfasb
    Sep 22, 2011 at 12:07
  • 1
    @WhitePhoenix: If explorer.exe has the executable open, you might want to check for your shell extensions with ShellExView as one might be incorrectly closing files that it opened... Sep 25, 2011 at 1:45
  • 1
    @WhitePhoenix: You can safely disable any non-Microsoft entries, you can always enable then again or reinstall the programs. The solely thing these things do is add functionality to the Windows Explorer so the programs themselves will still continue to function as well a Windows Explorer. It can only get better. Yes, posting a Process Monitor log can help... Sep 26, 2011 at 12:57

It is possible that the NTFS Master File Table is in error. See http://www.diydatarecovery.nl/kb_undelete_article.htm for an explanation. My first step would be to check the disk for errors. See http://www.howtogeek.com/howto/windows-vista/guide-to-using-check-disk-in-windows-vista/


The easy method for deleting file is to "right click" on the file, then "click on add to archive" then "click on delete file after compression" then click "ok" then go to archive dashboard an fined file an delete it, simple :) It recommended that you first use "Microsoft auto fix" before doing this. here is the link: https://support.microsoft.com/en-us/mats/windows_file_and_folder_diag

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .