右键菜单获取管理员所有权_如何在Windows资源管理器中的右键菜单中添加“所有权”

右键菜单获取管理员所有权

右键菜单获取管理员所有权

Taking ownership of files or folders in Windows is not simple. Both the GUI and command line take too many steps. Why not add a simple context menu command that lets you take ownership of any file or folder?

在Windows中获取文件或文件夹的所有权并不容易。 GUI和命令行都采取太多步骤。 为什么不添加一个简单的上下文菜单命令来让您拥有任何文件或文件夹的所有权?

You can add a “Take Ownership” command to your context menu by editing the Registry manually in two locations—one for files and the second for folders. You can also just download our one-step Registry hacks to make those changes for you.

通过在两个位置手动编辑注册表,可以在上下文菜单中添加“获取所有权”命令-一个用于文件,另一个用于文件夹。 您也可以下载我们的一步注册表注册表黑客为您进行这些更改。

In Windows, a user that has ownership of a file or folder has implicit rights to change permissions on that object. That user is also always allowed to access the file or folder—even when other permissions seemingly contradict that access. Sometimes, you might run into a situation where you need to take over the ownership of a file or folder. It might be a system file you need to alter to apply some hack—like replacing Notepad with another text editor—in which case, a built-in user account named Trusted Installer has the ownership by default. Or you might have a hard drive from another computer that you need to control files on.

在Windows中,拥有文件或文件夹所有权的用户具有更改该对象权限的隐式权限。 始终允许该用户访问文件或文件夹,即使其他权限似乎与该访问相抵触也是如此。 有时,您可能会遇到需要接管文件或文件夹的所有权的情况。 它可能是一个系统文件,您需要进行更改以应用某些hack(例如, 用另一个文本编辑器替换Notepad),在这种情况下,默认情况下,名为Trusted Installer的内置用户帐户拥有所有权。 或者,您可能需要另一台计算机上的硬盘驱动器来控制文件。

Whatever the reason, you can take ownership by using the various permissions dialog boxes in Windows or by using the Command Prompt. But both methods require that you complete several steps. With a few edits to the Registry, though, you can add a simple “Take Ownership” command to the File Explorer context menu that lets you take ownership in one step. We’re going to show you the manual method for making those changes to the Registry, but we also have a one-step hack you can use to install those changes without the hassle.

无论出于何种原因,都可以通过使用Windows中的各种权限对话框或使用命令提示符来获得所有权。 但是这两种方法都需要您完成几个步骤。 不过,通过对注册表进行一些编辑,您可以在File Explorer上下文菜单中添加一个简单的“ Take Ownership”命令,使您一步就可以拥有所有权。 我们将向您展示对注册表进行这些更改的手动方法,但是我们也提供了一步式技巧,您可以轻松地安装这些更改。

Note: The technique in this article works in most versions of Windows—from Vista on up through 7, 8, and 10.

注意 :本文中的技术适用于大多数Windows版本-从Vista到7、8和10。

通过手动编辑注册表来添加“所有权” (Add “Take Ownership” by Editing the Registry Manually)

To add a “Take Ownership” command to the context menu in any version of Windows, you just need to make some changes in the Windows Registry. It’s a fair list of changes, and you’ll be working in two separate Registry locations. But take your time, follow the steps, and you’ll get there. And if you’d rather not make the changes yourself, you can skip ahead and just download our one-step hacks. We would recommend at least skimming this section, though, so you understand the changes getting made.

要将“获取所有权”命令添加到任何版本的Windows的上下文菜单中,只需在Windows注册表中进行一些更改。 这是一份公平的更改列表,您将在两个单独的注册表位置工作。 但是,花点时间,按照步骤进行操作,您就会到达目的地。 而且,如果您不想自己进行更改,则可以跳过并直接下载我们的单步操作。 不过,我们建议至少略读本节,以便您了解所做的更改。

Standard warning: Registry Editor is a powerful tool and misusing it can render your system unstable or even inoperable. This is a pretty simple hack and as long as you stick to the instructions, you shouldn’t have any problems. That said, if you’ve never worked with it before, consider reading about how to use the Registry Editor before you get started. And definitely back up the Registry (and your computer!) before making changes.

标准警告 :注册表编辑器是一个功能强大的工具,滥用它会使您的系统不稳定甚至无法运行。 这是一个非常简单的技巧,只要您按照说明进行操作,就不会有任何问题。 也就是说,如果您以前从未使用过它,请在开始之前考虑阅读有关如何使用注册表编辑器的信息 。 并在进行更改之前一定要备份注册表 (和您的计算机 !)。

Open the Registry Editor by hitting Start and typing “regedit.” Press Enter to open Registry Editor and give it permission to make changes to your PC.

通过单击开始并键入“ regedit”来打开注册表编辑器。 按Enter键打开注册表编辑器,并授予其对PC进行更改的权限。

own_1

You’re going to make the same set of changes in two locations in the Registry. The first location adds the “Take Ownership” to the context menu for files of any type and the second location adds the command to the context menu for folders.

您将在注册表中的两个位置进行相同的更改。 第一个位置将“获取所有权”添加到任何类型文件的上下文菜单中,第二个位置将命令添加到文件夹的上下文菜单中。

将“获取所有权”命令添加到文件的上下文菜单 (Add the “Take Ownership” Command to the Context Menu for Files)

In the Registry Editor, use the left sidebar to navigate to the following key:

在注册表编辑器中,使用左侧边栏导航至以下键:

HKEY_CLASSES_ROOT\*\shell

Next, you’ll create a new key inside the shell key. Right-click the shell key and choose New > Key. Name the new key “runas.” If you already see a runas key inside the shell key, you can skip this step.

接下来,您将在shell键中创建一个新键。 右键单击shell密钥,然后选择“新建”>“密钥”。 将新密钥命名为“ runas”。 如果您已经在shell密钥中看到runas ,则可以跳过此步骤。

Next, you’re going to change the (Default) value inside the runas key. With the runas key selected, double-click the (Default) value to open its properties window.

接下来,您将更改runas键内的(Default)值。 选择runas键后,双击(Default)值以打开其属性窗口。

In the properties window, type “Take Ownership” into the “Value data” box and then click “OK.” The value you type here will become the command you see on your context menu, so feel free to change this to whatever you want.

在属性窗口中,在“值数据”框中键入“获得所有权”,然后单击“确定”。 您在此处键入的值将成为您在上下文菜单中看到的命令,因此可以随时将其更改为所需的任何值。

Next, you’re going to create a new value inside the runas key. Right-click the runas key and choose New > String Value. Name the new value “NoWorkingDirectory.”

接下来,您将在runas键中创建一个新值。 右键单击runas键,然后选择“新建”>“字符串值”。 将新值命名为“ NoWorkingDirectory”。

Now, you’re going to create a new key inside the runas key. Right-click the runas key and choose New > Key. Name the new key “command.”

现在,您将在runas键中创建一个新键。 右键单击runas键,然后选择“新建”>“键”。 将新键命名为“命令”。

With the new command key selected, double-click the (Default)value in the right pane to open it’s properties window.

选中新的command键后,双击右窗格中的(Default)值以打开其属性窗口。

In the “Value data” box, type (or copy and paste) the following text and then click “OK.”

在“数值数据”框中,键入(或复制和粘贴)以下文本,然后单击“确定”。

cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F

Now, you need to create a new value inside the command key. Right-click the command key and choose New > String Value. Name the new value “IsolatedCommand” and then double-click it to open its properties window.

现在,您需要在命令键内创建一个新值。 右键单击命令键,然后选择“新建”>“字符串值”。 将新值命名为“ IsolatedCommand”,然后双击它以打开其属性窗口。

In the “Value data” box, type (or copy and paste) the following text and then click “OK.” Note that this is the same command we just added to the (Default) value.

在“数值数据”框中,键入(或复制和粘贴)以下文本,然后单击“确定”。 请注意,这是我们刚刚添加到(默认)值的命令。

cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F

And that adds the “Take Ownership” command to the context menu for files. Let’s move on to the changes you need to make to get the command onto the menu for folders.

然后,将“获取所有权”命令添加到文件的上下文菜单中。 让我们继续进行所需的更改,以使命令进入文件夹菜单。

将“获取所有权”命令添加到文件夹的上下文菜单 (Add the “Take Ownership” Command to the Context Menu for Folders)

To add the “Take Ownership” command folders, you’re going to make essentially the same changes you just made in the previous section, but to a different location in the Registry. In Registry Editor, use the left sidebar to navigate to the following key:

要添加“获取所有权”命令文件夹,您将进行与上一节中所做的基本相同的更改,但是将其更改为注册表中的其他位置。 在注册表编辑器中,使用左侧边栏导航至以下键:

HKEY_CLASSES_ROOT\Directory\shell

Next, you’ll create a new key inside the shell key. Right-click the shell key and choose New > Key. Name the new key “runas.” If you already see a runas key inside the shell key, you can skip this step.

接下来,您将在shell键中创建一个新键。 右键单击shell密钥,然后选择“新建”>“密钥”。 将新密钥命名为“ runas”。 如果您已经在shell密钥中看到runas ,则可以跳过此步骤。

Next, you’re going to change the (Default) value inside the runas key. With the runas key selected, double-click the (Default) value to open its properties window.

接下来,您将更改runas键内的(Default)值。 选择runas键后,双击(Default)值以打开其属性窗口。

In the properties window, type “Take Ownership” into the “Value data” box and then click “OK.” The value you type here will become the command you see on your context menu, so feel free to change this to whatever you want.

在属性窗口中,在“值数据”框中键入“获得所有权”,然后单击“确定”。 您在此处键入的值将成为您在上下文菜单中看到的命令,因此可以随时将其更改为所需的任何值。

Next, you’re going to create a new value inside the runas key. Right-click the runas key and choose New > String Value. Name the new value “NoWorkingDirectory.”

接下来,您将在runas键中创建一个新值。 右键单击runas键,然后选择“新建”>“字符串值”。 将新值命名为“ NoWorkingDirectory”。

Now, you’re going to create a new key inside the runas key. Right-click the runas key and choose New > Key. Name the new key “command.”

现在,您将在runas键中创建一个新键。 右键单击runas键,然后选择“新建”>“键”。 将新键命名为“命令”。

With the new command key selected, double-click the (Default)value in the right pane to open it’s properties window.

选中新的command键后,双击右窗格中的(Default)值以打开其属性窗口。

In the “Value data” box, type (or copy and paste) the following text and then click “OK.”

在“数值数据”框中,键入(或复制和粘贴)以下文本,然后单击“确定”。

cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t

Now, you need to create a new value inside the command key. Right-click the command key and choose New > String Value. Name the new value “IsolatedCommand” and then double-click it to open its properties window.

现在,您需要在命令键内创建一个新值。 右键单击命令键,然后选择“新建”>“字符串值”。 将新值命名为“ IsolatedCommand”,然后双击它以打开其属性窗口。

In the “Value data” box, type (or copy and paste) the following text and then click “OK.” Note that this is the same command we just added to the (Default) value.

在“数值数据”框中,键入(或复制和粘贴)以下文本,然后单击“确定”。 请注意,这是我们刚刚添加到(默认)值的命令。

cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t

And you’re finally done. You can close Registry Editor. These changes should take place immediately, so test it out by right-clicking any file or folder and making sure you see the “Take Ownership” command.

您终于完成了。 您可以关闭注册表编辑器。 这些更改应立即进行,因此请通过右键单击任何文件或文件夹并确保您看到“获取所有权”命令来对其进行测试。

If you want to reverse the changes at any time, just head back into the Registry and delete the runas keys you created in both locations. This will also delete everything you created inside. If you already had runas keys in those locations—for example, you’ve applied other hacks—just delete the command keys you made instead.

如果您想随时撤消更改,只需回到注册表并删除在两个位置创建的runas项。 这也会删除您在其中创建的所有内容。 如果您已经在这些位置使用了runas键(例如,您已经应用了其他技巧),只需删除您创建的command键即可。

下载我们的一键式注册表黑客 (Download Our One-Click Registry Hacks)

There are a lot of steps if you perform this hack manually, so we don’t blame you for wanting to use the quicker method. If you don’t feel like diving into the Registry, we’ve created a couple of hacks you can use. The “Add Take Ownership to Context Menu” hack creates the keys and values you need to add the “Take Ownership” command. The “Remove Take Ownership from Context Menu (Default)” hack deletes those keys, removing the command and restoring the default setting. Both hacks are included in the following ZIP file. Double-click the one you want to use and click through the prompts.

如果您手动执行此hack,有很多步骤,因此我们不怪您想要使用更快的方法。 如果您不想进入注册表,我们已经创建了两个可以使用的技巧。 “将拥有权添加到上下文菜单” hack创建需要添加“拥有权”命令的键和值。 “从上下文菜单中删除所有权”(默认值)hack会删除这些键,从而删除命令并恢复默认设置。 这两种黑客都包含在以下ZIP文件中。 双击您要使用的一个,然后单击提示。

Take Ownership Menu Hacks

获取所有权菜单技巧

These hacks are really just the runas key, stripped down to the new keys and values we talked about in the previous section and then exported to a .REG file. Running the hacks just creates or deletes the keys for adding the command to the context menu. And if you enjoy fiddling with the Registry, it’s worth taking the time to learn how to make your own Registry hacks.

这些hack实际上只是runas密钥,被精简为我们在上一节中讨论的新密钥和值,然后导出到.REG文件。 运行hack只会创建或删除用于将命令添加到上下文菜单的键。 而且,如果您喜欢使用注册表,则值得花时间学习如何制作自己的注册表黑客

翻译自: https://www.howtogeek.com/howto/windows-vista/add-take-ownership-to-explorer-right-click-menu-in-vista/

右键菜单获取管理员所有权

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值