Delete a folder that lost its owner

前端 未结 5 1657
北海茫月
北海茫月 2021-02-12 18:55

I have found myself in a somewhat unique situation.

I have a folder. This folder, somehow, lost its owner.

In \"Advanced Security Settings for FOLDER\" under \"C

相关标签:
5条回答
  • 2021-02-12 19:20

    The ownership of the folder shouldn't affect its deletability, as long as the parent folder's access rights include write access for the deleting user.

    A folder doesn't really lose its owner, but its owner may cease to exist. However, the folder still has an owner ID, and for most intents and purposes, that is still valid.

    @birkner is on the right track. Check to see if you have any processes running in that directory, and if so, terminate them.

    0 讨论(0)
  • 2021-02-12 19:25

    If you tried to delete a file/folder and it failed due to a process holding on to it, it will lose it ownership. Use Process Explorer and do a search for the folder/file. It will show what process is using that folder/file. When you end the process, the folder/file will disappear.

    0 讨论(0)
  • 2021-02-12 19:31

    Download and add Take Ownership registry. Then right click on folder and press Take Ownership and choose your username.

    0 讨论(0)
  • 2021-02-12 19:42

    I had this problem when I had a cygwin terminal in the locked directory. After changing directories in the cygwin window, I was able to remove the windows directory.

    0 讨论(0)
  • 2021-02-12 19:47

    Try chkdsk /F in cmd with admin privilege!

    Because the folder may contain a file without owner, which is an error in your file system.

    If that folder is in your boot disk (C:), cmd will ask you whether to scan when the next time you launch the computer, type "y" to confirm.

    After the scan chkdsk will delete the damaged file(s).

    I got this problem after uninstalled Android Studio, I can't delete C:\Program Files\Android\Android Studio. Tried DEL/RD/TAKEOWN/ICACLS... for one hour, none of them works for me. Then I realized, that folder contains some damaged files without owner... Guess it's a bug of Windows or Android Studio...

    This is one of the possibility why some folders or files cannot be deleted even with admin privilege.

    Hope this helps the questioner and people who have the same problem!

    0 讨论(0)
提交回复
热议问题