PostWindows 7 – Can’t delete exe files on Desktop

March 6, 2009 – 1:18 am

During my testing of Windows 7 I have had almost no issues to report, the only things that have been of notice have been third party or driver related. Then there’s the permissions bug, this bug is so elusive that hardly anybody has reported it and nobody has a solution, not even me.

Update 1: It appears that as of build 7068 this bug may have been fixed, see comments below for details.

Update 2: There are reports the bug has reappeared in the RTM build, it can also occur in Windows Vista but slightly less often.

Update, September 2 2009: It has been mentioned below that this website has a possible fix and that it can fix both Windows Vista and Windows 7. I don’t get this bug any more on any of my machines so I am unable to verify it however.

The issue is fairly simple, occasionally after running a file from the Desktop or a subfolder thereof (I am fairly certain the file does not have to be run first though, it just happens more often if it is, (usually a setup program, but can be something as simple as a small test application) upon attempting to delete the file you get:

1. The UAC dialog wishing to confirm the deletion pops up, you click Ok (if UAC is off or disabled then go to straight to step 2)
2. An error message pops up exclaiming that you must get permission from the owner, or that you must be an administrator, it will give you the option to try again or skip.
3. Clicking try again pops up the same message, over and over and over again.
4. The IT admin in you gets confused “But I am the administrator, my user is a member of the Administrators group”
5. There must be some mistake, you attempt to grant yourself ownership of the file by right clicking and….
6. Right clicking results in a wait of more than 30 seconds during which an attempt to do anything else in the explorer window will cause Windows to assume that it has at least temporarily stopped responding, also it will then cause the menu to disappear as soon as it comes back.
7. Once you have worked this out, you click Preferences and go to the security tab where you normally change ownership, upon viewing the ownership screen you stumble upon the message Current owner: Unable to display current owner, not uncommon when the file is created on another computer etc. On attempting to change owner to yourself you get the message ‘Access Denied’.
8. You go for more advanced deletion methods, unlocker, unlock, using the command line for every windows based ownership, takedown command you can find, nothing will make the file move.
9. You may give up, don’t worry the file will magically delete itself after about 30 minutes or so, also if you restart the file will also disappear.

This is very frustrating when you are doing things that require the deletion of exe files often.

The file doesn’t work with any kind of logic, once it’s locked it will be unable to be deleted until Windows (I’m assuming it’s Windows, or whatever causes the problem in the first place) decides to delete it.

It seems that the action of attempting to delete the file in the first place is what gives it these permission-excluding superpowers, before the attempted deletion the file will act correctly, opening and closing when you want, renaming and copying as you please, obviously with no indication of what it will do if you try to delete it.

This happens on the desktop, I really haven’t experienced it anywhere else, it may also occur in the user folder but I haven’t checked.

Running as the administrator, either by opening explorer as an administrator or by enabling the administrator account and then logging in with it will give sufficient permissions to delete this file.

This is unlike any permissions issue i have ever come across on any operating system, every file is deletable, even if you have to go as the root or admin account, this file however disobeys every possible windows based and 3rd party command thrown at it.

There are no disk errors, at least none found by chkdisk, restarting and running /r on my main drive is a little counter productive since as soon as I reboot the file will be gone so there will be no file issue to be found, for the record though, I have, no issues.

This is not the same as the issues people have in Vista and Windows 7 where folders can’t be deleted sometimes, as they can be deleted simply by taking ownership of them, or even by deleting the files in the folder individually.

I have submitted a bug report.

Software I have installed and have been run:

MS Visual Studio
RealVNC
iTunes
Quicktime
Firefox
Battlefield 2
Adobe Digital Editions
TextPad
7-Zip
Foxit Reader
Avira Premium Security Suite
VideoLAN
TortoiseSVN
Windows Live, :Just the messenger
CCleaner

Most importantly, I have formatted and reinstalled Windows 7 as previously I had upgraded from Vista and there seemed to be a possible link between upgrading and getting permission issues but now I’m not so sure.

If anybody has any information on this issue please comment below, does it happen to you? Do you have a remedy that works for you? Does it happen when you have performed a full install or an upgrade from either Vista or a previous build (!important!)? Do you have any of the same software installed as me? I’m taking particular interest in CCleaner and Avira here.

Related posts:

  1. Windows 7 Conexant Sound Card Issue
  2. Windows x64 plagued with BS news stories
  3. Windows Vista SP2 release before Windows 7
  4. Using Symbolic Links in Vista/Windows 7 for Google Chrome User Data
  5. Age Of Empires 2 in VMWare

Comments:

  1. Im running build 7000 of the Windows 7, and have the same problem. And I run CCleaner =O. In face I think it started when I used ccleaner for the first time.

  2. Well that’s a good coincidence, I didn’t mention it in the post but it didn’t occur the second time until after running CCleaner, I can’t replicate the problem in Vista so I will assume there’s some sort of incompatibility between the two.

    I still don’t know if there’s a solution once the problem starts other than reinstalling windows or formatting.

  3. I’m running build 7022. I continue to experience access denied errors when trying to delete files. I’m unable to isolate where the problems occurs(common file location) but it does appear to be executable files only. I did find a work around (safe mode) so now I just wait until I have a number of them and I’ll reboot. Submitted BRs. It’s eerily similar to the problems with Vista’s folder security. One step up and two steps back.

  4. I’m experiencing exactly the same problem. After using Linux primarily for a long time I gave a try to Windows 7 (x64). It seems to be faster than Vista but this bug(?) really bugs me :@ I hate rebooting the computer (a reason for using Linux) and I need now :@ Updating an application is impossible since it cannot replace executables with newer ones.

    It happens everywhere. I mean Desktop, Documents, Downloads, ProgramFiles/…, ProgramFiles(x86)/…, my external harddisks….. everywhere …..

    The thing is not about upgrading from vista because I installed 7 two times and never upgraded from vista.

    Here are installed programs on my computer in common with yours:

    MS Visual Studio
    Firefox
    Avira Premium Security Suite
    Windows Live, :Just the messenger
    CCleaner

    It is not related to Visual Studio and Avira because I had the same problem before installing them. I can’t say anything about Firefox, WLM and CCleaner because when I install windows the very first thing I do is installing those three.

    I’ll check here from now on. We may find something :)

    PS: CSS doesn’t validate (3 errors) ;)

  5. CCleaner is definitely a good suspect here then, it certainly does nothing of the sort to Vista, but somehow it seems to be doing something that Windows 7 doesn’t like, it would be good to find out what, it may be a specific option in the program that we’re all choosing. BTW I’ll have a check on CSS.

    Edit: It was the polls plug in, I wasn’t using it anyway.

  6. The same problem has been happening to me…
    It is extremely annoying… It especially sucks because I’m a programmer and it prevents me from using Dev C++ due to the fact that every time I compile it has to remake the exe file… the one that has no-user-permission-super-godlike-admin-killing-wont-ever-go-away power… /cry /wrists /bleeds_out_and_dies

    Programs on my computer:
    Firefox
    Steam
    Dev C++
    Borland C++ Builder 6
    CCleaner

  7. Well the only thing we all seem to have is CCleaner and Firefox and I wouldn’t imagine Firefox causing any system wide issues like that.

    To future commentators, If you have CCleaner it would help if you post in a list what general CCleaner removal settings you use, I’m assuming it’s one specific setting that is causing this problem, not simply having it installed or running it.

  8. Windows

    • Internet Explorer
      • Temporary Internet Files
      • Cookies
      • History
      • Recently Typed URLs
      • Index.dat files
      • Last Download Location
    • Windows Explorer
      • Recent Documents
      • Run (in Start Menu)
      • Search Autocomplete
      • Other Explorer MRUs
      • Thumbnail Cache
    • System
      • Empty Recycle Bin
      • Temporary Files
      • Clipboard
      • Memory Dumps
      • Chkdsk File Fragments
      • Windows Log Files
      • Windows Error Reporting
      • Start Menu Shortcuts
      • Desktop Shortcuts
    • Advanced
      • Old Prefetch Data
      • IIS Log Files
      • Custom Files and Folders

    Applications

    • Firefox/Mozilla
      • Cookies
      • Download History
      • Internet Cache
      • Internet History
    • Applications
      • MS Office Picture Manager
      • Office 2007
    • Internet
      • Sun Java
      • Windows Live Messenger
    • Multimedia
      • Adobe Flash Player
      • Windows Media Player
    • Utilities
      • Windows Defender
      • WinRAR
    • Windows
      • RegEdit

    And all the Registry Integrity issues.

    I also used wipe free space and secure file deletion.

    If I have time I’ll install Win7 to another partition and won’t install CCleaner to see if this problem occurs then.

  9. Ups! See the source for tabbed list :)

  10. I tabbed using HTML so it can be displayed more easily, you seem to be using most of the same settings as me, I know for sure I don’t use any in the Firefox list, didn’t do the registry cleaner once and didn’t try wipe free space at any time either.

  11. I have the same problem here and I haven’t upgraded from Vista. I confirm also that this problem occurs with all file types and everywhere on my HDD. I’m running Win 7 build 7000.

    Programs on my computer:
    VS 2008 SP 1
    Firefox, skype, pidgin, chrome
    Avira Personal Edition
    Photoshop CS4
    Codegear RAD Studio 2009
    CCleaner
    office 2007
    quicktimes, iTunes
    netbeans + jdk

  12. I upgraded to build 7068 yesterday. The problem seems to be solved. ..but we will see..

  13. Let us know how it goes, I will also upgrade my laptop to 7068 to see if it’s fixed.

  14. Please do let us know if this is fixed in 7068… although, we all probably will have to wait until RC to get the fix.

    This bug is pretty frustrating… but I do want to point out that I don’t have CCleaner and I also have the problem on build 7000.

    I posted my info here:
    http://social.technet.microsoft.com/Forums/en-US/w7itprogeneral/thread/4301c7d1-88ba-4c94-88c2-e5f1850f062f/

    With screenshots of my problem here:
    http://docs.google.com/Doc?id=dhdmpbwp_8cs22zhgq

  15. I’m on build 7000 x64 and have been using it since the past 2-3 weeks.
    This problem started happening today afternoon.

    I cannot delete any exe file anywhere on my system. A system restore at first did fix the issue for a few minutes but it resurfaced in 10-15 minutes and system restore fails to be of any help.

    I hope 7068 fixes this issue, will upgrade soon.

  16. Is it really possible to upgrade or do I have to completly reinstall?

    But more important for me is to know, wheter the bug is gone with 7068. Someone know?

  17. Yay! I have no problem with 7068 :)

    @m0h1t: Do you have CCleaner as we all have?

    @mullo: Yes it is possible if your computer is plugged in and has ~11GB free space. Also you have to start setup IN windows for upgrade not at boot time.

    After upgrading some software may seem more unstable but later they get used to new shiny 7068 :D (Chromium crashed everytime I tried, but later worked well)

    And you may have license problems for some software like Avira Premium Security Suite. Just register/activate one more time :)

  18. Yup I have CCleaner aswell.

  19. 7068 appears to fix this problem for me on my laptop, I’ll do some more testing over the next couple of days.

    @Jayson Go: I have a feeling this can be caused by something other than CCleaner as well, whatever it is, CCleaner appears to set it off straight away each time.

  20. @Ben: Yeah, my exe’s get affected when I execute them. I imagine, CCleaner is somehow doing some file access on the executable.

    At any rate, here’s another question… it seems that people running build 7068 are claiming the problem is gone. This seems like the type of problem that Microsoft, let alone us peons (no offense intended), would consider critical… my question is, where’s the communication from Microsoft? I understand that 7068 is an internal/private build… but someone has either directly or inadvertently fixed this bug… i just want to hear that this has been addressed, “officially”. I love win7, but I could never use it for development (which i do now) if the problem persists.

  21. I had the same thoughts on the problem, I’d say they picked it up during internal testing but we probably won’t know for sure until an RC comes out.

    I’m still waiting to put Windows 7 back on my main pc but so far my laptop still has no problems.

  22. So, I am not alone then.

    I often have this problem – do a build in VS 2008 an debug. End, and then I cannot rebuild as the file is locked. It seems to go away after some undetermined period of time, but its an enforced break in the code-test-repeat cycle which is very annoying.

    I had the problem, repeatable every time, which came when I was installing the Windows 7 SDK. A prereq MSI was being extracted, run, and then deleted – or, at least the delete was tried. Every single time, the temp MSI could not be deleted and the larger install failed. I actually would have to boot in to Ubuntu to delete the file, then back to 7 again.

    Highly frustrating. While I also run CCleaner, I had always assumed that it was something to do with protecting me form myself, as the issue is only with executable files. I figured Defender was holding the file or something. Ive given up trying to guess on it, ill just be glad when the problem goes away.

  23. Bug IS GONE here with BUILD 7068!

    Thank you! :-)

  24. It’s great news for people being able to get this fixed in build 7068, I have not had this problem since using this build.

  25. I have the bug in Win 7 7077

  26. Thanks for the info SM.

    I’m yet to try 7077 but I’ll report back when I have a chance to confirm.

  27. The BUG still lives on 7077

  28. CCleaner 2.18.878 has just come out, is that what you are using? I’m about to test it out on 7077 x64 now.

  29. With all due respect, I think everyone should stop relating this error to CCleaner. People are having issues with this without CCleaner and has something to do with deleting a file (that seems to take 30min or more) to do so.. but during that time, it marks the file as Private or some inaccessible state.

  30. I agree, the problem is no longer caused by CCleaner (if it was in the first place) in any tests I have tried in the past 2 builds.

    Does anybody have any steps they follow that causes this problem to start? even intermittently?

    There are quite a few little file system anomalies other than this, for example the issue where you delete a file and it stays where it is for a while before disappearing as it should. Also the problem that seems to be closer to this where you can’t delete a folder unless you remove the files inside it.

  31. In my case, I’m debugging a C# application. VS2005/VS2008 for WinForms and VS2008/Blend3 for WPF. At any point when any of these executables are loaded (double clicking, or invoked via IDE’s during debugging), the problem is in it’s “initial” state. As long as you don’t try to delete the file, you’re okay (that’s why I say initial). However, if you try to delete it, the problem is intermittently there… and especially with development where a rebuild attempts to delete the file, thats when the issue is first noticed.
    It does seem that the Win7 is in the middle of deleting the file (i.e. marked it for deletion) but doesn’t actually successfully complete it (until much later). Until that time, the file is marked Private and cannot be deleted (because technically it’s already being deleted). Consequently, parent folder(s) also cannot be deleted. I’ve read reports that if you wait it out, it will eventually be deleted. But personally, an immediate restart also “fixes” the problem. However, on a restart, it seems the pending deletion of the file is ‘cancelled’ because the file is still there (after the restart)… but is no longer in the Private state, which means you can again delete it (but since it hasn’t been loaded, the delete is successful).

    I wish I could get a hold of all these other builds that are reporting the bug to be fixed.

  32. For Files:

    takeown /f file_name /d y
    icacls file_name /grant administrators:F

    For Directories (will perform action recursively):

    takeown /f directory_name /r /d y
    icacls directory_name /grant administrators:F /t

    Above syntaxes will grant full permission to administrator group hence you must be a part of administrator group to take advantage of above command.

    BTW I’m using Build 7000 x64, if you have any questions email me at dbarras@gmail.com

    Sorry for the multiple posts, but I ran this from the command line on my Desktop folder and haven’t had the problem since.

    Found this online:

    Add this to a text file and name it own.reg

    [HKEY_CLASSES_ROOT\*\shell\runas]
    @=”Take Ownership”
    “NoWorkingDirectory”=””

    [HKEY_CLASSES_ROOT\*\shell\runas\command]
    @=”cmd.exe /c takeown /f \”%1\” && icacls \”%1\” /grant administrators:F”
    “IsolatedCommand”=”cmd.exe /c takeown /f \”%1\” && icacls \”%1\” /grant administrators:F”

    [HKEY_CLASSES_ROOT\Directory\shell\runas]
    @=”Take Ownership”
    “NoWorkingDirectory”=””

    [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
    @=”cmd.exe /c takeown /f \”%1\” /r /d y && icacls \”%1\” /grant administrators:F /t”
    “IsolatedCommand”=”cmd.exe /c takeown /f \”%1\” /r /d y && icacls \”%1\” /grant administrators:F /t”

    Then double click. Now you can right click on files or folders to take ownership EASILY!

  33. @Daniel
    I have already tried using the /takeown command (and I assume most everyone that has the problem has also done so) and it yields the very same error as if doing it from GUI (as one would expect since it would inevitably call the same Win API). The problem is not specifically with ownership. The problem is due to the fact the file is in the middle of being deleted (whatever that really means), so any file operations performed on the file (taking ownership, another attempt at deletion, etc) fails.

    If you want more information on the error, you can read up on this post:
    http://social.technet.microsoft.com/Forums/en-US/w7itprogeneral/thread/4301c7d1-88ba-4c94-88c2-e5f1850f062f/

  34. I condensed your comments into one Daniel, Jayson is right as this specific problem isn’t technically a permissions problem as permissions don’t have a chance to come into effect.

    I do however encourage people suffering from a permissions error to follow Daniel’s instructions, also if you’re unsure if you’re suffering from this issue or if you are just suffering from a permissions issue then give it a go first.

  35. Has this issue been resolved in later builds?

    Believe it or not, I had the exact same issue with Vista!

  36. I haven’t experienced the issue in the latest public release (7100 Release Candidate), anyone who is running the Beta build is encouraged to upgrade to it.

    I haven’t heard of it happening in Vista before, but I assume it’s possible in certain situations.

  37. I just had this happen to me on RC 7100… All’s I did was enable HomeUsers full access to the folder… For some reason it wasn’t seeing me access the folder as the username I am under… Setting that let me take the Read-Only attribute off the folder and files and I could delete the files finally.

  38. I am have the same issiu on 7100, I am using a SSD though.

  39. I’m planning on upgrading to RC next week… I’ll report what I find, as well. I’m hopeful.

  40. I had the same problem with W7 beta and VS2008 and I was using CCleaner, too. Now I’ve moved back to XP, so no idea about the RC.

  41. Update:
    I installed Win7 RC (Build 7100) this morning… and almost done with the reinstallation of my base applications. After installing VS2008+SP1, I created a Console Application. I hit Rebuid serveral times (approx. x10 and approx. 1 second apart per rebuild). When I rebuilt a little too fast, I get the same error I did in the past (about not being able to access it, etc.). But a subsequent rebuild (no more than 2 seconds after getting the build error), it builds successfully. I also tried debugging it (which causes the executable to be launched), then closing the app, then deleting all the debug files (exe included) and able to do so.

    With this quick test, I’m optimistic that the issue is gone… and 110% ECSTATIC! Hopefully, the issue doesn’t come up again… and so if you don’t hear from me again… you can assume that I’m not encountering it :)

    Jayson

  42. Great news Jayson

  43. The problem (for me) happens when an app deletes a file and immediately generates it (same name). However, the first file hasn’t been fully deleted yet, so somehow that file became stuck in a transient state (neither here nor there). Because of that, the permission for that file is all screwed up and no amount of permission tweaking will bring it back. The only way is to reboot the machine. Once rebooted, the file goes away by itself. I’m using 7100 and ultimately had to turn off my Harddrive’s write cache to get it to work. No noticable performance hit, though. Hope this helps.

    David

  44. Did you do an upgrade David? Some people still experienced this on 7100 after doing an upgrade. Being fixed by turning of the write cache gives a good insight into why this is happening.

  45. Sorry, should have been clear. I did a clean install of 7100. After a couple days of testing, I can confirm that the Write Cache trick worked. I was able to turn on all other services that I thought were interfering without any problems.

    David

  46. I have the same problem on Win7 RC (7100).
    Unbelievable nobody noticed this ;)

    Disabling the write cache did not help for me.
    (But I did not restart after changing the setting – is this required?)

    If it really is caused by write caching, it may help to reduce the flush time. (If this is possible)

    Other idea:
    Which mainboards do you have? Chipset drivers installed? Especially IDE/SATA/Storage drivers?

    I’m on nForce 550, with nVidia 15.35 Win7 64bit drivers.
    (This installs an IDE storage driver)

  47. You should restart after changing the write caching setting.

    I was on Intel Raid using a few different driver versions, all experienced the same thing.

  48. Disabling write-cache + rebooting did not help. Still reappearing .exe files. :/

  49. I would try turning off the Application Identity service. That seems to work for me

  50. Sorry hit return too quick. I think it has to do with the applocker. I dunno if you guys have figured this out yet but I have had Win7 RC for about 4 days now and was restoring backups from XP and have been having the same problem. I went through the services list and turned off the ones I wasn’t using, tried turning off Application Identity and disabled it and i haven’t had any issues since.

  51. I have heard of the Application Identity service causing this problem before, personally I’m not sure why it would be doing this as it’s description doesn’t say anything about locking any files, unless it’s caused by a bug somewhere.

  52. Disabling the Application Identity service alone did not fix the problem for me :( I am running RC1.

  53. BTW, I have noticed this does not happen on partitions formatted with FAT. It only occurs on NTFS volumes.

  54. I imagine It would require the NTFS security to lock the files, using FAT probably isn’t a good workaround though (lack of security, 4GB file limit etc).

    Did you do an upgrade from a previous version, or is it a fresh install?

  55. Hi there,
    I read all your post, i will like to say that i am using VISTA 64bit sp2, and have the same problem.
    even in fat drives. the moment i use(run) an exe file, i can’t delete it. for me it happened after i used visual studio 2008, haven’t noticed it before. the same thing can’t recompile because it can’t delete the exe file.
    only after restart.
    reformatting and reinstalling is not an option for me.

  56. I did get that problem for a short time in Vista on occasion, I don’t know of a fix for it though.

  57. Hey! Guys
    This bug occured in 7600.16385 too.
    Software I installed in common with Ben:
    Firefox
    Avira Antivir(but Professional)
    Windows Live, :Just the messenger

    I disabled some services:
    Appliction Assistant
    Windows Firewall
    Windows Defender
    peer-to-***(something like this)

    I wonder how to fix this..

  58. Same problem exists on Windows 7. 6.1 build 7600 RTM. Certain things like folders etc are not deletable unless the system is restarted, then they’ll delete.

  59. It’s not good news if this bug has appeared again in the RTM version. I am unable to test that version but as of the RC version I am still not experiencing this error anymore, which makes me think I’m either doing something different now that I wasn’t before or the bug has changed to some degree in the way it manifests itself.

  60. I have W7 7600 rtm and cannot delete certain files until I restart system. I’m using ccleaner also.

    If someone could tell How to fix this without reinstalling W7.

  61. Hi Peter, so far there hasn’t been any fix for it. Re-installation hasn’t fixed the problem for anyone yet so I wouldn’t recommend giving it a go unless you’re really willing.

  62. I have this same problem in build 7100 with a video file on the desktop. After deleting it, it comes back after 10 seconds. I can’t watch it, though, because the video player says something like “file not found”. Windows also says I don’t have permissions.

  63. Does the error continue after you restart the computer?

  64. Hey guys,

    I noticed this discussion when trying to search for a solution to a similar problem on W7 RC build 7100 x64. This problem, however, occurred after setting up a HomeGroup after I had installed the same W7 build on my laptop. The bad thing about this situation is that the problem is not with a file but with c:\ itself. It’s completely inaccessible under the same conditions listed in this article, even after hours of administrator command prompt takeown and icacls fiddling. Not even allowed to restore!

    Besides that, it results in previously installed programs not being able to run as they dont have permission to write to c:\, even as administrator with full rights.

    The frustration is indescribable!

  65. I also just experienced this on build 7600.

    An exe file, downloaded with Filezilla via ftp, onto a subfolder of the desktop.

    I can’t delete, read, or take ownership even from an elevated command shell.

    This is a serious bug for an RTM build…

  66. I have been experiencing for a long time now and I have found that the only way to fix the “can’t open” error, where even if you give yourself permissions you still can’t access the file, is to copy it and delete the “locked” one. I had to do this for my entire music/video library and the pain is excruciating.

  67. I have the same problem, Andy, and stumbled onto this thread looking for a solution. I do NOT want to do a clean install of RC 7100. The problem began when I was fiddling with Homegroup, trying to get the machine to see another RC7100 in my home network. Hope someone can help.

  68. I have actually had some similar problems in the past with Homegroup messing up my permissions, I won’t touch it and will disable every part of it on a new install now to make sure it doesn’t happen.

  69. I found a solution to my particular form of the problem here:

    http://social.technet.microsoft.com/Forums/en-US/w7itproinstall/thread/85b02262-6856-4dbd-981f-0744a0791ab4

    I hope it works for you guys too!

    When I first fixed it, the problem ending up coming back in a milder form, but then it disappeared again without me doing anything. Since then i have turned off UAC all together and have not looked back since. But see what works for you guys.

  70. I found an answer to the problem I was having here:

    http://social.technet.microsoft.com/Forums/en-US/w7itproinstall/thread/85b02262-6856-4dbd-981f-0744a0791ab4

    It involves editing the registry to remove UAC restrictions. Also I noticed that windows update installed a fix directly related to this problem today. The update is called KB972407. I’d suggest trying the update before the regedit, as the problem did resurface for me, so I ended up turning UAC off permanently. Hopefully the hotfix will address it permanently.

    Hope this helps! Post back if it works (=

  71. Get it here:

    Update for Windows 7 Release Candidate (KB972407)

    Update for Windows 7 Release Candidate for x64-based Systems (KB972407)

    As the name suggests this is for Windows 7 RC, it has probably already been fixed in RTM.

  72. Wow, I just ran into this issue, I also have visual studio 2008 and noticed this bug when it wouldn’t overwrite an EXE file I had just compiled and ran. Now it happens on any EXE file on the system, sometimes I can delete them sometimes not. I looked in process monitor and the files are marked as DELETE PENDING. So obviously the files are trying to be deleted but aren’t. According to microsoft DELETE PENDING means not all handles have been closed, however I looked in another application to see if any open handles to the files existed and they did not.

    This just happened out of the blue, I had been running Win 7 7100 for months doing the same thing with no problem. What changed? Who knows.

  73. I’m also on Win7 x64, 7100 just so people who follow this can find it.

    Things I’ve tried that don’t work
    1) Disabling write caching
    2) Uninstalling every extra driver outside of the video and sound ones
    3) Removing luafv file system filter driver
    4) Disabled all services like readyboost, etc

    Nothing works, you cannot take ownership of these EXE files. The weird thing is sometimes they do get deleted instantly sometimes not. The other weird thing is it only happens with REAL exe files, renaming a text file to EXE doesn’t make this weird issue happen. So there is something in windows 7 that is freaking out on EXE files when they are read and keeping secret handles open to them.

  74. Ok I think I may have found a solution after spending the whole day on this problem.

    “Application Experience” service. Since enabling that I haven’t had this issue. If the problem comes back I will report back here. But thank FU@#$@#@#@#@ it has gone for the time being.

  75. BTW I found the information about this service from this website
    http://www.retrocopy.com/blog.aspx?post=28

    I hope it helps someone else!

  76. Thanks for the valuable information, I’ll put it up the top.

    I had heard of the Application Experience service when I first experienced this problem however it was suggested to disable it instead, which now seems may have made the problem worse.

    Also it appears the service is started only when required as it’s set to Manual on Windows 7 RTM and is in the running state on mine at the moment without me manually starting it, would it help some people to set it to Start Automatically in cases where it doesn’t start when Windows requires it?

  77. I enabled it once and then disabled it (testing) and didn’t get the same issue until reboot. It might kick start some driver the first time it loads or something. It might also only start when new applications run also (when in manual mode), anything that didn’t change in the cache would likely be fine I’m guessing. New files created or dropped that aren’t in the cache will have issues unless that service is running.

  78. Enabling Application Experience fixed the bug for me!!! =) im so happy now!!!!!

    btw, check this out:
    http://www.blackviper.com/Windows_7/Services/Application_Experience.htm

  79. I’m having a similar issue but not with exe-files so enabling Application Experience didn’t fix my problem. When saving a file in Photoshop CS4 for a second time I often get an error message saying “Filename was not valid”. When trying to save again I get “Could not save, the file is locked”. At this point I have two options:
    1) Wait for about 10 – 15 minutes and save normally.
    2) Save with another name and delete the original file.

    To make things more interesting it’s not mere Ps issue. When saving a TXT-file with Notepad for a second time I sometimes get the same behaviour, but it seems to be related to whether I have the preview pane open in Explorer (from where I open the TXT-file). So the preview seems to assign locks to previewed items. I thought there was similar behaviour with preview in Bridge but I’m not too sure about that anymore as Ps sometimes refues to save even when Bridge is not open.

    Sorry for this longwinded post but seems this is about the only place with intelligent discussion about the subject.

    Running 32 bit Windows 7 6.1.7600

  80. Grab one of the popular “file unlocker” programs to see if anything has an open handle to the file. Another issue I have had recently is Microsoft thumbnail cache keeping certain files open when it shouldn’t.

  81. I have noticed the thumbnail cache keeping files locked for a short time but I don’t find it to be as bad as it used to be in Vista though.

  82. I have the same problem. It has reduced my programming work by at least 20%. I re-enabled Application Experience service to see if this will fix it, if not, I am certainly back to Windows XP.

  83. I support a software application and I first encountered this problem from someone that was using Windosw 7 but I have since seen it (or a very similar problem) in Vista SP1 and in WinXP SP3. In my experience it is not limited to any particular file types.

    Has anyone here experienced this problem in WinXP? I’m still looking for a solution/workaround, or even simply an explanation that I can give users who experience this.

  84. I haven’t seen this occur in XP, it would only lock out a file when it is being accessed. It all seems to have started with Vista, then it got worse and more common with Windows 7, although with the later builds it did mostly go away for some users.

    I still haven’t experienced the bug in Windows 7 since the later builds (perhaps it is related to certain hardware or driver versions?). I have had a few times where a file would be temporarily out of bounds, but that changes only after about 30 seconds to a minute, building applications with Visual Studio works fine with no lockouts.

    Have you tried the ‘Application Experience’ fix from above? I am interested to know how that works for others.

  85. Ben,

    Thanks for your reply. I will try the Application Experience fix when I encounter this again. The thing is (as has been pointed-out here) that the problem is transient, so it may not be immediately clear if any change in behavior is due to enabling “Application Experience”.

    In any case, when I have any result I will report it here.

  86. The problem has been solved!
    Just turn ON the “Application Experience” Service, then the files could be deleted instantly.
    look here for details: http://www.retrocopy.com/blog/28/cant-delete-exe-files-in-vista–windows-7-solved.aspx

  87. Thanks Ben & Imazed, that worked out for me.

    The problem also occurs anywhere, not just on the desktop, when trying to delete a folder that contains one or more executables and folder which has been recently browsed before deletion.

    The same service made batch or command files (.cmd) to be locked. If I executed one and then tried to edit it, it would say that it’s in use and I had to pick another name… luckily and weird, I could delete it and re-save… :-?

    The link from Imazed also points out to the GPE’s entry of the service, which helps turning off some of those annoying assistants.

  88. Just reboot it with the “Directory services restore” mode and delete-it. ;)

Trackbacks/Pingbacks:

  1. Link: Windows 7 Locking Executable Files « A Mind Lost
    Date: May 1, 2010
    Time: 11:47 am

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <p> <q cite=""> <strike> <strong>

Please leave these two fields as-is:

Protected by Invisible Defender.