Fatal Error: Cannot create output file "project1.exe"

Marck picture Marck · Aug 7, 2012 · Viewed 41.4k times · Source

So for some time now I keep having this problem:

on windows 7 (64bit), with Delphi 7 and Delphi XE2, if from within the IDE, I compile a program, run it, stop it, change it and rerun it I get this error message:

[Fatal Error] Cannot create output file "project1.exe"

I have no clue to what causes this. I googled for more information, but I could not find a solution.

There are two workarounds: either wait a minute or two, or delete project1.exe manually. Needless to say, this is unworkable.

I do not have a virus scanner, and no virus. Have full access to related folders. Run everything as Administrator.

So what causes this? And what can I do to fix it?

Answer

Marck picture Marck · Aug 8, 2012

I found the solution. It appears that disabling the service "Application Experience" caused this. When disabled the task "system" will lock "any" executable for some time.

Re-enabling "Application Experience" is the solution.

Found via:

https://superuser.com/questions/260375/why-would-system-continue-locking-executable-file-handles-after-the-app-has-exit