I have problem overwriting any .exe from windows explorer (drag/drop or copy paste) I receive the error message: "The action can't be completed because the folder or a file in it is open in another program". I used a sysinternal tool to check who has a hold on the said file and it is the System process.

Let say I have the following file structure rootfolder\a.exe rootfolder\someotherfolder\a.exe

1- If I open windows explorer into rootfolder and I drag/drop a.exe on someotherfolder, a.exe inside someotherfolder gets overwritten correctly.

2- If I have two instance of windows explorer opened at the same time, one inside rootfolder, one inside someotherfolder and I drag/drop a.exe over the other a.exe I receive the error message.

Now what's weird is if I am to close someotherfolder and try to repeat step 1, it fails with the same error message. System keeps a handle on the file for quite a few seconds until after I close the folder.

I tried turning indexing service off, I disabled UAC, I disabled anti-virus. I'm running windows 7 64bits on a domain, my user is admin of my machine, when I look the rights of the said file it says that my user has full control over it. I'm a bit clueless about what to do to solve this.


As weird as it may sound (I don't really understand) but following the steps described in this blog post corrected everything.

Basically I typed the following in an administrator Command Prompt and it all started to work magically:

net user administrator /active:yes


When you drag and then drop a file over a exe file, you are telling Explorer to launch the target exe file and open the dragged exe file. That is the default behavior. Which is not the case in your system.

My guess is a third party program. Any copy/drag n drop handlers installed on your system?

  • Actually, I'm drag/dropping on the background white space to initiate a copy/overwrite, not directly on top of the executable ICon. Also, as far as I know, I dont have any handlers installed. + I would expect that handler to appears as the one locking on the file, not the System Process. – Benoittr Aug 18 '11 at 15:18

Give the program Unlocker a shot. Not only is it free and compatible with all versions of Windows from 2000 up to 7, it allows you to "unlock" file handles from processes without terminating them (of course, you are also given the latter option).

This is the only utility I've found to date which allows you to do this (unlock file handles without terminating processes or rebooting a computer).

As for why this is actually happening, it could be Windows trying to cache the application icon, or an external process (i.e. antivirus) scanning the file. Unlocker will tell you what process has locked the file, so it should give you an idea of why this is occuring.

  • I allready know which process is using it: it's the System Proess (PID:4). I've already turned off UAC/Indexing/Thumbnail generation off and still no success. But as soon as I'll get 16 rep I shall upvote you for pointing me to a tool that can unlock a file without killing the process, very useful. – Benoittr Aug 18 '11 at 20:11
  • 1
    technet.microsoft.com/en-us/magazine/… suggests this might not be good idea – OJW Feb 27 '12 at 13:36
  • This is a terrible idea, for the reason that OJW linked (archive version just in case): you can cause serious data corruption when the other program tries to reuse the handle. – NH. Mar 7 '18 at 23:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.