none
Can't take ownership of or delete some files created by application installer

    General discussion

  • Hi,

    I have some files that were created by the Steam Client installer. The installer failed and left behind a directory called Steam in the "Program Files (x86)" directory. There are two files called Steam.exe and SteamTmp.exe that I cannot delete. It looks like the files don't have the owner attribute set or something because when I login as Administrator and go into explorer to look at their properties, in the Owner field I see the words "Unable to display current owner."

    When I try to take ownership there it won't allow it.

    I also tried the following from the cmd window:

    C:\Program Files (x86)>takeown /F steam /R /A

    SUCCESS: The file (or folder): "C:\Program Files (x86)\steam" now owned by the administrators group.

    INFO: Access is denied. ( "C:\Program Files (x86)\steam\Steam.exe" )

    INFO: Access is denied. ( "C:\Program Files (x86)\steam\SteamTmp.exe" )

    How can I remove these files?

    TIA,
    Nick.
    • Changed type Mark L. FergusonModerator Friday, February 13, 2009 11:45 PM OP dropped the thread. The latest Springboard chat showed how to use Resource monitor to find what process owns a file.
    Wednesday, February 04, 2009 12:53 PM

All replies

  • There's a handy little program called Killbox.exe that will let you write in the path to those files and delete them. It's freeware and you can find it on Google. It's worked for me in the past.  Rob
    Wednesday, February 04, 2009 1:33 PM
  • Once you take ownership you have to then give yourself permission to delete the files. Right click on the folder (or file) and pick Properties. Click on the Security Tab. Click on Administators. Give the group Full Control.

    It may be that these files are use. Open the Task Manager. Click on the Processes Tab. Click on Show Processes From All Users. Look for those filenames. If they are there you may be able to use End Process to stop them but this is not the recommended way. You should try to figure out where the processes are started from and stop them from starting. Msconfig may help. You could also try Autoruns. Once the processes are not running and you have the needed permissions you should be able to delete the files.

    http://technet.microsoft.com/en-us/sysinternals/bb963902.aspx


    Kerry Brown MS-MVP - Windows Desktop Experience
    Wednesday, February 04, 2009 3:15 PM
  •  

    EDIT:

    I did not see Kerry Brown's reply.  I regress.
    -------

    After you issue the takeown command, you then have to grant yourself the permissions to then delete the file.  I have run into similar instances in the past.  Just taking ownership is not enough if you already don’t have permissions.

    • Edited by DarienHawk67 Thursday, February 05, 2009 2:58 AM Ooops
    Thursday, February 05, 2009 2:57 AM
  • Kerry_Brown said:

    Once you take ownership you have to then give yourself permission to delete the files. Right click on the folder (or file) and pick Properties. Click on the Security Tab. Click on Administators. Give the group Full Control.


    Notice that you can't do this in one go.

    You must first take ownership and then exit all the way out.

    You can then go into properties again and apply full rights.

    Thursday, February 05, 2009 2:22 PM
  • I think you are all missing the point here. This is the same problem me and a few other people discussed in another topic. The access denied on the .exe files is actually when trying to take ownership. You can't take ownership, nor change permissions for them. Things I have tried but have not worked to access such .exe files are: different levels, including disable of UAC, activating the built-in administrator account (not even with this account could I take ownership) and disabling indexing and volume shadow copy services. After waiting a while it seems it does become possible to delete these files, but what changes is a mystery to me.
    Thursday, February 05, 2009 5:05 PM
  • Xerion404 said:

    I think you are all missing the point here. This is the same problem me and a few other people discussed in another topic. The access denied on the .exe files is actually when trying to take ownership. You can't take ownership, nor change permissions for them. Things I have tried but have not worked to access such .exe files are: different levels, including disable of UAC, activating the built-in administrator account (not even with this account could I take ownership) and disabling indexing and volume shadow copy services. After waiting a while it seems it does become possible to delete these files, but what changes is a mystery to me.



    That indicates that some process has the file open and locked. You have to figure out what process this is, stop the process, then you can do whatever you want to the file.

    Kerry Brown MS-MVP - Windows Desktop Experience
    Thursday, February 05, 2009 7:15 PM
  • Problem is, I had already tried killing all processes not belonging to win7 itself. Also I can't find a handle on the file when I try to with process explorer. And I don't understand why windows would be unable to even show who is the owner of the file just because it is locked.

    EDIT: As a test I just tried to delete a file which I had open. When I try to do this windows actually says the file is open so it can't delete it. This is not what happens with the files affected by the problem this topic describes. It will just deny access to everyone for everything. Since it has only happened with exe files, I was thinking it was some protection mechanism that kicks in, but I can't find out what it would be.
    Thursday, February 05, 2009 7:21 PM
  •  


    Xerion404

    Try this if you have not already.

    Enable your administrator account by typing net user administrator /active:yes.  Ensure you know the password if you have one set.  Reboot the machine hitting <F8> as the machine is booting back up.  Enter Safe Mode Command Prompt.  Log in as the new enabled local administrator.  Navigate to the affected directory as see if you can delete the files in c:\program files (x86)\steam.

    If you have to reset the ownership and permissions while in Safe Mode Command prompt, type explorer to start the shell.  In some cases, you have to take ownership and reset permissions one file at a time.  Then delete the files individually prior to deleting the host folder.  Make sure the files are not inheriting permissions from the parent folder.   Use the advanced permissions dialog box if necessary.

    After you are sure that is done, kill explorer.exe via Task Manager and use the DEL command to erase each file.  If you are able to successfully remove them, then go up one directory and issue a RMDIR to rid the system of the offending directory.

    Reboot.

    I hope that helps

    Friday, February 06, 2009 1:38 AM
  • First of all, I am not the topic starter, who was having his steam files affected. In my case there are many exe files being affected, which usually becomes apparent when I try to repace them, either manually or through an application installer. It does not matter whether I run as my own user or as administrator. Also I have activated the built-in administrator already to check permissions, but even that account cannot see or change them, or take ownership. When I try to delete the offending file, explorer shows it as actually disappearing, but when I refresh it's back. Sometimes the file actually does get deleted, but only after waiting a really long time. While the suggestion of rebooting in safe mode to reset permissions might work, it's just not an option. I have programs that update daily, and games that get patches all the time. I don't want to have to reboot into safe mode everytime just to get these files accessible again. Not to mention the fact that they get inaccessible before the actual update/patch is applied which means it happens again each time I run the program and it never even gets patched.
    Friday, February 06, 2009 6:01 AM
  • Hi everyone,

    I just started to peruse this site trying to answer the same questions that the topic starter, Xerion and possibly others are having with the inability to delete files (or more specifically, the inability to take ownership of the files).  I can see that people are attempting to help, but quite frankly (but understandably so), the direction their attempts to solve the problem are incorrect.

    The files that we are attempting to delete are not in use nor are they running (in the case of executables).  In fact, Windows is unable to display who the current owner of the file is, let alone give you the ability to take ownership of it.  I apologize for piggy-backing onto this topic but I believe my error is 100% relevant.

    Here is my situation: I have a C# (Windows Form) project.  It is set to do debug with the visual studio hosting process (vshost.exe).  After a few debugging attempts, and an attempt to rebuild the project, it begins to fail with an error stating that it is unable to copy the "vshost.exe" file.  I have compile a list of screenshots, with descriptions at the bottom, exhibiting this behavior, and placed them in a Word document.  I couldn't find a way to attach the word doc here, so I uploaded it to Google Docs and published it [1].

    Here's a summary of what is going on (so that this post may be searchable):
    - The vshost.exe cannot be deleted.  It is not running nor is it in use by any process
    - After the attempt to delete it, it begins to show a property of "State: Private" when selecting the file and looking at the Details pane.
    - When viewing the properties of the file, under the Security tab, Windows reports "Unable to display current owner".  Subsequently, taking ownership of the file results in an "Access denied" error, which I can only assume is due to Windows "not knowing" who the file belongs to and therefore cannot properly execute the attempt to take ownership or deletion.
    - I also tried taking ownership of the file using the "takeown" command line, with the same results of an "Access denied" error.
    - The only way to delete the file is to restart the computer.  To everyone that is starting in safe mode... that is not necessary, just restart it and you will have the ability to delete it afterwards.

    - One final thing: If I change my .NET project to not use the visual studio hosting process, I am able to work on my project and debug it just fine.  HOWEVER, the problem is still there, over time.  For example, if I debug the application and keep it running/debugging for a longer period of time (i.e 30 minutes), then I close it and debug it again, the "ownership" problem is then there, again... but this time, (obviously) not with the vshost.exe but the executable itself.


    [1] http://docs.google.com/Doc?id=dhdmpbwp_8cs22zhgq 
    Please vote for my MIX 10K Challenge entry called VisualSort.
    Direct Link: http://2009.visitmix.com/MIXtify/TenKDisplay.aspx?SubmissionID=0002
    Sunday, March 29, 2009 1:41 PM
  • Is it possible that your antivirus software is blocking access to these files? What antivirus software do you use, and have you tried disabling it and seeing if the problem still arises?
    Sunday, March 29, 2009 2:03 PM
  • Hi Gary,
    I have CA ETrust installed but I currently have the services disabled.  The only thing that may interfere is Windows Defender.

    Oh, one more bit of info, I have also tried running Visual Studio in both elevated and normal permissions.. and still the same effect.

    Does Microsoft monitor these forums pretty, well?  I wonder if we can get some kind of response from them and I would love to help in any way.
    Please vote for my MIX 10K Challenge entry called VisualSort.
    Direct Link: http://2009.visitmix.com/MIXtify/TenKDisplay.aspx?SubmissionID=0002
    Sunday, March 29, 2009 3:58 PM
  • Hi egads,

    Thanks for the links.  I'm "glad", in a wierd way, that I'm not the only one experiencing this issue and probably a bit more optimistic that we'll all figure out what's causing this eventually, one way or another.

    Based on some of the questions that floated around in the other topics, I also want to be clear that this is a clean install of windows 7.

    Also, your last link "this thread" returns a 404.

    Thanks and if I find out anymore, I'll also post here.


    To Xerion404,
    Did turning off Shadow Copy and/or Indexing have any effect?  I'm guessing not at this point, but can't hurt to ask since I didn't hear a yay or nay regarding that action, yet, from the other forums.
    Please vote for my MIX 10K Challenge entry called VisualSort.
    Direct Link: http://2009.visitmix.com/MIXtify/TenKDisplay.aspx?SubmissionID=0002
    Sunday, March 29, 2009 4:23 PM

  • 404?  Clueless?   Hahaha!  It works fine here on 2 computers running IE7 .   :))

     

    Yeah... I was laughing pretty hard myself....
    Please vote for my MIX 10K Challenge entry called VisualSort.
    Direct Link: http://2009.visitmix.com/MIXtify/TenKDisplay.aspx?SubmissionID=0002
    Sunday, March 29, 2009 5:04 PM
  • For anyone having this problem and have tried "things" that have not worked, please post what you did (i.e. turned off XYZ service).

    I'll start:
    - Turned Off: Superfetch (Result: Problem persisted)

    EDIT 2009-03-30:
    - Turned Off: Windows Defender
    - Turned Off: Windows Search
    - Turned Off: Disk Defragmenter
       (Results: Problem still persisted)

    EDIT 2009-04-22:
    - No progress, and error is just as annoying as ever.  It even happens on .cmd files.
    - Turned Off: Application Information (service).  Result:  Completely hosed my system.  I 100% do not recommend turning this off.  If you did manage to turn it off, I've posted some steps on how to fix it here [1].  Ultimately, and obviously, the service remains on Automatic :)

    [1] http://thevistaforums.com/index.php?showtopic=52591 
    • Edited by JaysonGo Wednesday, April 22, 2009 2:42 PM New update(s)
    Monday, March 30, 2009 3:54 PM
  • Same problem here.

    The weird thing is that I've been running Win7 with VS2008 for a few months now, and I never had the problem up to a week or so ago.
    I disabled superfetch, uninstalled my virusscanner, disabled defender, but no luck.

    Any resolution for the problem would be great. A workaround maybe? I know that when I reboot and be quick I can delete the files manually, but debugging is hedious this way.
    Tuesday, April 07, 2009 9:03 AM
  • Now it gets even weirder!

    I was surfing a bit searching for other solutions for this problem and returned to my explorer showing the semi-locked file. I clicked on it to see exacly what message shows up in the statusbar (State:private Shared with:Nobody).

    I surf a bit on and return to my explorer window, and what do you guess: The file suddenly disappeared! Its gone! And I have not a single clue whatsoever why its gone. I pressed delete on it several minutes ago (maybe half an hour) but then it reappeared after hitting F5.

    My intuition tells me there must be something in the filesystem kernel of Win7 that does this. When such a file gets deleted the kernel accepts the operation, but for some reason the process of actually deleting the file takes ages. It would explain the ownerless state the file lingers in, since the file has been marked for deletion, but still sits in some cache somewhere. Denied access on a file marked for deletion sounds plausible too. Some kind of an 'undead' file...

    Does this make any sense? Or is it just wishful thinking?

    Tuesday, April 07, 2009 9:17 AM
  • @Joep Beusenberg
    I would agree 99.9% of your assessment, that the "operation is accepted" but the actual completion of the operation doesn't happen until much later.  I myself have never experienced "deleting then waiting" (because frankly I have not waited that long, i always restarted, which "fixed" the issue).  However, all the accounts that I've read about this error indicates that the file does go away after some time... I'm guessing that if I waited as well, that the file would be deleted.

    Here's another site that's also "lively enough" about this issue that I've been tracking myself:
    http://www.techgremlin.com/2009/03/06/windows-7-cant-delete-exe-files-on-desktop/ 
    Tuesday, April 07, 2009 3:49 PM
  • Here's another site that's also "lively enough" about this issue that I've been tracking myself:
    http://www.techgremlin.com/2009/03/06/windows-7-cant-delete-exe-files-on-desktop/ 
    According to that thread the bug has been solved in newer builds of Win7 (yay!). Can you (or someone else) confirm that this is true for 'our' specific problem?

    I dont really feel like reinstalling a new build when it doesn't solve my problem and someone else already tried it.
    Wednesday, April 08, 2009 6:56 AM
  • Not me.  I'm running build 7000.  The new builds are suppose to be internal/private builds... so either the people reporting them are part of that internal testing of those new builds (which it doesn't sound like it) or they've gotten their builds from a source not directly from Microsoft.

    I wish they would just put a simple fix out on WindowsUpdate for this though... but again, lack of communication.
    Wednesday, April 08, 2009 6:20 PM
  • Hey guys,

     I have the exact same issue with the deleted exe files reappering after a refresh F5, or not being able to be deleted at all. Same issue as well with Visual Studio when I launch my debug exe, and close it...I cannot overwrite it anymore...


     Was a solution found to this problem?
    Monday, May 04, 2009 5:05 AM
  • I don't know of any solution or feasible work-around to this on build 7000.  However, the RC is now out and some people who had build 7000+ claimed that it was fixed in their builds... so I am hopeful that this has been addressed in the RC.

    Monday, May 04, 2009 5:07 AM
  • Thanks for the quick reply Jayson.

    I am running on 7000 as well.

    Hopefully RC1 would have fixed this and that transitionning from Beta1->RC1 isn't a big hassle. ( I know MS recommends clean install of RC1 but I don't feel like re-installing the whole OS right now for a simple bug fix)
    Monday, May 04, 2009 5:15 AM
  • OK,

     So tonight it got worst...The only thing I did was update CCleaner version.

     Now I cannot delete *any* exe I execute once.

     But I discovered that by forcing a dismount on the volume (like for a scandisk) and remounting it...I can delete the exe...it is like some handle is opened somewhere or something...

    Update:

      In fact this gets weirder and weirder...It is worst than I thought...not only you cannot delete the exe that you lanched onced, but you cannot delete any other executable with the same name or signature anywhere on the system!

      So if I had a file a.exe on c:\ and on f:\ and I just restarted...and I run c:\a.exe, anc close it..I will be not able to delete neither c:\a.exe Nor f:\a.exe!

      Something is fubar...
    • Edited by Dave Doubi Monday, May 04, 2009 10:53 AM update
    Monday, May 04, 2009 7:18 AM
  • suggestions:

    try booting into safemode and removing the "unknown accounts" with unidentifiable SID's; as shown in the picture below: (remove and apply and then delete the files)

    http://www.sevenforums.com/attachments/system-security/10327d1241959090-unknown-account-appears-windows-7-2009-05-10_143717.jpg 

    if the installer files are related to the SYSTEM group somehow (oddly enough) and the above does not work; try booting a live cd
    and deleting the files.

    1 free way:
    download an ISO image of knoppix and boot it live.
    open the file manager, mount the NTFS partition (by clicking on it), and delete your files.

    Wednesday, September 23, 2009 5:11 PM
  • 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
    Wednesday, December 09, 2009 4:09 AM
  • Sorry to necropost, but ajfenix was right on the money. I've been battling with this issue for ages, mostly with Steam. This resolved the issue immediately, Steam was able to flawlessly update without booting to safe-mode (huge PITA).

    Thanks again! +Rep

    Saturday, May 08, 2010 1:04 AM
  • I know this thread is old but I just solved a problem exactly the same as this one. What I did was used a bootable Linux OS, Ubuntu 10.04 to be exact, and I mounted the drive the folder was on and then moved the folder to the trash and empty the trash and voila, gone. Linux can and will delete files from Windows that Windows is uncapable of deleting.
    Monday, July 05, 2010 2:10 AM
  • Two things will prevent a file from being deleted. If it is in use. If permission is not granted. You may not be able to take ownrship if the parent folder belongs to another group.
    Monday, July 05, 2010 8:04 AM