Unable to delete files or folders for non-system related files


  1. Posts : 4
    Skellitor301
       #1

    Unable to delete files or folders for non-system related files


    I have had issues with windows taking folder and file permissions from me for random and non-windows items like ShareX. I've tried looking online for answers but none of them have really given me the ability to regain ownership and make alterations to these files/folders. I have lost the ability to use certain programs cause of this, again like ShareX, tried to update it and found it was locked by permissions, now the folder is entirely useless and I can't reinstall the program because of this problem. Some of the things I've tried was through powershell in administrator mode I tried takeown, del, and remdir, none of which worked. I had a registry edit that added a shortcut to takeown in the context menu for explorer, still nothing. Any help with this would be greatly appreciated.
    System: Windows 10 pro (version: 1809)
      My Computer


  2. Posts : 5,330
    Windows 11 Pro 64-bit
       #2

    Hello Skellitor301, and welcome to Ten Forums.

    Where is this folder located?

    What error message do you get when you execute Takeown command?
      My Computer


  3. Posts : 4
    Skellitor301
    Thread Starter
       #3

    Thanks :)

    C:\Program Files\ShareX

    When I run takeown /F 'C:\Program Files\ShareX\' it says it gives me ownership, but when I go to check ownership I get the "unable to display current owner"
      My Computer


  4. Posts : 5,330
    Windows 11 Pro 64-bit
       #4

    Did you uninstall this program?
      My Computer


  5. Posts : 4
    Skellitor301
    Thread Starter
       #5

    I tried to, but I kept getting that ownership issue, so there it stayed.
    I've been working on it and idk what fixed it, but it did? Only thing I changed since was I tried changing the ProgramFilesDir in the registry to a different drive since that was something I was going to do anyway, hoping I could just make it install to a different drive since ShareX doesn't give you the option of where to install. Between that and dskchk which was run, and a restart of my system, my permissions were restored, and I was able to delete the folder (after having to taskkill sharex since I couldn't find it in the processes list). Unfortunately, the ProgramFilesDir didn't work as intended and it still installed to the C: drive
      My Computer


  6. Posts : 5,330
    Windows 11 Pro 64-bit
       #6

    Execute following commands one at time:

    Code:
    takeown /f "C:\Program Files\ShareX" /r /d y 
    
    icacls "C:\Program Files\ShareX" /grant administrators:F /t
    
    Rd /s /q "C:\Program Files\ShareX"
      My Computer


  7. Posts : 4
    Skellitor301
    Thread Starter
       #7

    Like I said idk what I did but I fixed it, it could've been the dskchk I ran before restarting. But yeah now I have full permissions to the folder again. I'll keep your commands handy incase I run into this issue again.

    Side note, I am trying to change my default install location to a different drive, since C: is a 110gb ssd that was only intended for the OS. I've been trying to get this changed for programs like ShareX that doesn't give me the option to set the install location
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 04:02.
Find Us




Windows 10 Forums