如何删除 Windows 10 上无法访问的文件夹?

如何删除 Windows 10 上无法访问的文件夹?

我的硬盘上有一个文件夹,P:\csharp\aperture\keystone\src\Keystone我想删除它但无法删除。我尝试了多种方法来更改/重置权限,但仍然无法删除此文件夹。

PS P:\csharp\aperture> whoami
azuread\mikelloyd

PS P:\csharp\aperture> rm -Recurse -Force .\keystone\
rm : Cannot remove item P:\csharp\aperture\keystone\src: The directory is not empty.
At line:1 char:1
+ rm -Recurse -Force .\keystone\
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (src:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand
rm : Cannot remove item P:\csharp\aperture\keystone\: The directory is not empty.
At line:1 char:1
+ rm -Recurse -Force .\keystone\
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (P:\csharp\aperture\keystone\:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand

PS P:\csharp\aperture> rmdir .\keystone\

Confirm
The item at P:\csharp\aperture\keystone\ has children and the Recurse parameter was not specified. If you continue, all children will be removed with the item. Are you sure you want to continue?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): A
rmdir : Access to the path 'P:\csharp\aperture\keystone\src\Keystone' is denied.
At line:1 char:1
+ rmdir .\keystone\
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (P:\csharp\aperture\keystone\:String) [Remove-Item], UnauthorizedAccessException
    + FullyQualifiedErrorId : RemoveItemUnauthorizedAccessError,Microsoft.PowerShell.Commands.RemoveItemCommand

PS P:\csharp\aperture> icacls.exe .\keystone\ /reset /T
processed file: .\keystone\
processed file: .\keystone\src
.\keystone\src\Keystone: Access is denied.
Successfully processed 2 files; Failed processing 1 files

我没有阅读权限。

无读取权限

它无法显示所有者:

无主

如果我尝试更改所有者,则我没有权限查看或编辑该对象:

在此处输入图片描述

真正奇怪的是,我用我的用户创建了该文件夹,所以我应该是实际所有者。我曾尝试以管理员身份删除该用户,但我也无法做到这一点。我甚至无法以以下身份删除该文件夹NT\System

P:\csharp\aperture\keystone\src>whoami /user

USER INFORMATION
----------------

User Name           SID
=================== ========
nt authority\system S-1-5-18

P:\csharp\aperture\keystone\src>rmdir /S Keystone
Keystone, Are you sure (Y/N)? Y
Access is denied.

nt 系统权限

我怎样才能删除我创建的这个文件夹?

答案1

尝试一下:首先,检查您的用户帐户是否为管理员。以管理员身份运行 cmd,输入takeown /f P:\csharp\aperture\keystone\src\Keystone,这应该会授予您该目录的所有权。最后,输入rmdir /q /s P:\csharp\aperture\keystone\src\Keystone 如果仍然不起作用,请在安全模式下尝试相同的步骤。希望这对您有所帮助。

答案2

尝试一下 unlockme:UnlockMe 是一款免费软件应用程序,用于删除、移动或重命名被其他进程锁定的文件或文件夹。

https://www.majorgeeks.com/files/details/unlockme.html

相关内容