2

Yesterday I was debugging an application. I've stopped the program, modified it then I tried to run it and got this error message:

Error   1   error LNK1168: cannot open E:\DEVELOPMENT\Projects\Visual Studio 2013\GameEngine\bin\Debug\EngineCore.exe for writing   E:\DEVELOPMENT\Projects\Visual Studio 2013\GameEngine\EngineCore\LINK   EngineCore

I've opened the task manager and saw the process, so I've tried to kill it. I wasn't able to. Then I restarted the computer, but got the same error. I've tried deleting the file but I got a message that it's still in use. I've opened task manager again but I couldn't find the process. For a temporary solution I've switched to release mode as that seemed to work until now, when the same thing happened to the release mode process. I have no idea why this happened.

I have Windows 10 64 bit and Visual Studio 2013

Edit:

I've downloaded Process Explorer, found the process but I just can't kill it (error message: "Access denied")! If I restart the computer it's still there. I got it's PID and tried to force-kill it ( taskkill /pid 13684 /f ) but it didn't work either.

Edit2:

I've tried using a live CD. I deleted the exe file. I've quadruple-checked it. But when I booted into windows10, the file reappeared.

Then I've downloaded Unlocker, which couldn't delete the file, but after a restart I was able to delete it manually.

  • What are the permissions on EngineCore.exe? Can you rename it? You can download Process Monitor from sysinternals to easily find what process has the file open (F3 - Search string - Enter ) – Lieven Keersmaekers Aug 20 '15 at 8:59
  • I'll download process monitor. – Peter Lenkefi Aug 20 '15 at 9:03
  • I can't find the process there either. – Peter Lenkefi Aug 20 '15 at 9:08
4

A reboot will generally fix things. If not, then the system may be loading the file in some way.

Cedrick 'Nitch' Collomb's Unlocker has been known to coerce Windows in allowing a file to be deleted/renamed/etc. when the file appears to be locked. It's an older utility. It's actually worked in a surprisingly high number of cases, although system instability (until the system is rebooted) could occur (and has been known to occur, in a very small number of cases). Despite being an older utility, it has historically been known to work wonders, so it may be worth a shot.

Otherwise, you might want to try deleting the file when your computer is not running a version of Windows that is installed to the "hard drive" (or "SSD" or whatever your "primary storage" is). Instead, boot off of a Live CD. That way, the Windows permissions (including locks for current in-use files) should not be an issue, and you should be able to rename/delete the file.

  • I had the same situation as the post but the troublesome process was 'atom.exe' and it prevented deletion of it's directory in Appdata and the reinstallation of 'atom'. The solution was to download 'Unlocker' -> unlock the file/directory -> reboot -> delete file/directory. After the reboot, the process was no longer running and deleting the directory was allowed. – MikeB Sep 27 '17 at 15:15

protected by bwDraco Nov 21 '15 at 21:09

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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