如何使用特定用户的命令行在Windows中查看文件夹权限?

时间:2019-03-20 06:32:26

标签: windows permissions

我想使用命令提示符来执行此操作,有时我们需要检查用户权限,所以请提出如何在Windows中使用命令行查看权限的建议。

1 个答案:

答案 0 :(得分:0)

您可以在cmd中使用icacls命令。像这样:

icacls folder/file name

例如:

>>> C:\Users\Username> icacls Desktop

Desktop NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)
BUILTIN\Administrators:(I)(OI)(CI)(F)
ComputerName\Username:(I)(OI)(CI)(F)


在Powershell中时,可以使用命令Get-Acl

例如:

PS C:\Users\Username> Get-Acl


    Directory: C:\Users


Path       Owner               Access
----       -----               ------
Username   NT AUTHORITY\SYSTEM NT AUTHORITY\SYSTEM Allow  FullControl...

或获取该目录中所有文件和文件夹的信息:

PS C:\Users\Username> Dir | Get-Acl


    Directory: C:\Users\Username


Path                     Owner                  Access
----                     -----                  ------
.anaconda                Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.android                 Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.atom                    Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.aws                     Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.conda                   Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.config                  Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.DataGrip2018.2          Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.dotnet                  NT AUTHORITY\SYSTEM    NT AUTHORITY\SYSTEM Allow  FullControl...
.elasticbeanstalk        Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.idlerc                  Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.ipython                 Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
.keras                   Owner Name             NT AUTHORITY\SYSTEM Allow  FullControl...
... List goes on ....