cmd 查看文件权限_Win10右键菜单添加“获取文件管理员权限”选项

本文介绍了如何在Windows 10系统中通过命令获取和取消超级管理员权限,以解决文件访问被拒绝的问题。用户可以通过创建注册表文件实现右键菜单中添加和移除"管理员取得所有权"选项,简化文件操作过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

文件访问被拒绝,你需要TrustedInstaller提供的权限才能对此文件进行更改/文件访问被拒绝,你需要权限才能执行此操作/你需要提供管理员权限才能移动此文件

两种方案

一长期

为Win10右键菜单添加“获取文件管理员权限”选项 - Windows10.Pro​www.windows10.pro
3756de9bff9b5fe7498cea3c78da08da.png

一、获取Win10超级管理员权限

新建一个文本文件,然后把以下命令复制到文本中:

Windows Registry Editor Version 5.00[HKEY_CLASSES_ROOT*shellrunas]@="管理员取得所有权""NoWorkingDirectory"=""[HKEY_CLASSES_ROOT*shellrunascommand]@="cmd.exe /c takeown /f "%1" && icacls "%1" /grant administrators:F""IsolatedCommand"="cmd.exe /c takeown /f "%1" && icacls "%1" /grant administrators:F"[HKEY_CLASSES_ROOTexefileshellrunas2]@="管理员取得所有权""NoWorkingDirectory"=""[HKEY_CLASSES_ROOTexefileshellrunas2command]@="cmd.exe /c takeown /f "%1" && icacls "%1" /grant administrators:F""IsolatedCommand"="cmd.exe /c takeown /f "%1" && icacls "%1" /grant administrators:F"[HKEY_CLASSES_ROOTDirectoryshellrunas]@="管理员取得所有权""NoWorkingDirectory"=""[HKEY_CLASSES_ROOTDirectoryshellrunascommand]@="cmd.exe /c takeown /f "%1" /r /d y && icacls "%1" /grant administrators:F /t""IsolatedCommand"="cmd.exe /c takeown /f "%1" /r /d y && icacls "%1" /grant administrators:F /t"

然后把该文本文档命名为“Win10管理员取得所有权.reg” ,然后双击导入注册表即可,这样就获得了Win10超级管理员权限。在任意文件或文件夹上点击右键即可看到“管理员取得所有权”选项。

二、取消已获取的Win10超级管理员权限

这里指的是取消右键菜单中的“管理员取得所有权”选项。方法是新建一个文本文档,把以下命令复制到文本中:

Windows Registry Editor Version 5.00[-HKEY_CLASSES_ROOT*shellrunas][-HKEY_CLASSES_ROOTDirectoryshellrunas][-HKEY_CLASSES_ROOTdllfileshell][-HKEY_CLASSES_ROOTDriveshellrunas][-HKEY_CLASSES_ROOTexefileshellrunas][HKEY_CLASSES_ROOTexefileshellrunas]"HasLUAShield"=""[HKEY_CLASSES_ROOTexefileshellrunascommand]@=""%1" %*""IsolatedCommand"=""%1" %*"-----------------------------------------------
三、恢复原始的Win10超级管理员权限Windows Registry Editor Version 5.00;恢复原始权限 [HKEY_CLASSES_ROOT*shellrunas-] @="恢复原始权限""Icon"="C:WindowsSystem32imageres.dll,101""NoWorkingDirectory"=""; && takeown /f "%1"[HKEY_CLASSES_ROOT*shellrunas-command] @="cmd.exe /c takeown /f "%1" && icacls "%1" /reset && cacls "%1" /e /r "%%USERNAME%%"""IsolatedCommand"="cmd.exe /c takeown /f "%1" && icacls "%1" /reset && cacls "%1" /e /r "%%USERNAME%%""[HKEY_CLASSES_ROOTexefileshellrunas2-] @="恢复原始权限""Icon"="C:WindowsSystem32imageres.dll,101""NoWorkingDirectory"=""[HKEY_CLASSES_ROOTexefileshellrunas2-command] @="cmd.exe /c takeown /f "%1" && icacls "%1" /reset && cacls "%1" /e /r "%%USERNAME%%"""IsolatedCommand"="cmd.exe /c takeown /f "%1" && icacls "%1" /reset && cacls "%1" /e /r "%%USERNAME%%""[HKEY_CLASSES_ROOTDirectoryshellrunas-] @="恢复原始权限""Icon"="C:WindowsSystem32imageres.dll,101""NoWorkingDirectory"=""[HKEY_CLASSES_ROOTDirectoryshellrunas-command] @="cmd.exe /c takeown /f "%1" /r /d y && icacls "%1" /reset && cacls "%1" /e /r "%%USERNAME%%"""IsolatedCommand"="cmd.exe /c takeown /f "%1" /r /d y && icacls "%1" /reset && cacls "%1" /e /r "%%USERNAME%%""

然后把该文本文档命名为“Win10取消管理员取得所有权.reg” ,双击导入注册表即可,这样就取消了超级管理员权限。

如果你嫌自己动手太麻烦的话,可以下载Microsoft酋长制作好的两个reg文件,解压后,直接双击导入注册表即可。

二 exe程序

巧用WinOwnership一键临时获取文件管理员权限 - Windows10.Pro​www.windows10.pro
f42584bdb372161eecaf46301a7ec58b.png

来源

为Win10右键菜单添加“获取文件管理员权限”选项 - Windows10.Pro​www.windows10.pro
3756de9bff9b5fe7498cea3c78da08da.png
巧用WinOwnership一键临时获取文件管理员权限 - Windows10.Pro​www.windows10.pro
f42584bdb372161eecaf46301a7ec58b.png
在Win10右键菜单添加“获取管理员权限/恢复原始权限”选项 - Windows10.Pro​www.windows10.pro
c6fa1262cf184f8cb08dfac4ff63af81.png
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值