Have you ever tried to unzip a file to the Program Files directory in Windows 7 or Vista? You’ll get all sorts of permission denied errors, and generally be unsuccessful. So how do we open up the zipfile as an administrator? For that matter, how do you open any file as administrator?
您是否曾经尝试将文件解压缩到Windows 7或Vista中的Program Files目录中? 您会遇到各种权限被拒绝的错误,并且通常是不成功的。 那么,我们如何以管理员身份打开zipfile? 因此,您如何以管理员身份打开任何文件?
There’s a simple registry tweak that will let us specify the action to run as administrator for a file type. Unfortunately you’ll have to make the tweak manually, but we’ll walk you through it.
有一个简单的注册表调整,可以让我们指定文件类型以管理员身份运行的操作。 不幸的是,您必须手动进行调整,但是我们将引导您完成调整。
Note: The method explained here is courtesy of jd2066, one of the helpful geeks over on our forum.
注意:此处说明的方法由jd2066提供,jd2066是我们 论坛 上最有用的怪胎之一 。
Manual Registry Tweak
手动注册表调整
Open regedit through the start menu search or run box and then browse down to the following key, substituting “.zip” for the file extension that you are looking for. (Note that the find dialog helps here)
通过开始菜单搜索或运行框打开regedit,然后向下浏览至以下键,用“ .zip”替换您要查找的文件扩展名。 (请注意,“查找”对话框对此有所帮助)
HKEY_CLASSES_ROOT\.zip
HKEY_CLASSES_ROOT \ .zip
Now you want to take note of the Data value for the “(Default)” item. This tells you which application is registered to handle this file type, and also where we need to go in the registry next.
现在,您要记下“(默认)”项的“数据”值。 这将告诉您注册了哪个应用程序来处理此文件类型,以及接下来需要在注册表中输入的内容。
For this example, since the data field in this example says “WinRAR.ZIP” we’ll need to browse down to the following registry key. (again, the find dialog helps here)
对于此示例,由于此示例中的数据字段显示为“ WinRAR.ZIP”,因此我们需要向下浏览至以**册表项。 (同样,“查找”对话框对此有所帮助)
HKEY_CLASSES_ROOT\WinRAR.ZIP\shell\open\command
HKEY_CLASSES_ROOT \ WinRAR.ZIP \ shell \ open \ command
What we want to do is copy the shell\open\command section to shell\runas\command. The easiest way to do that is right-click on “command” and then choose Export.
我们要做的是将shell \ open \ command部分复制到shell \ runas \ command。 最简单的方法是右键单击“命令”,然后选择“导出”。
Now open up the exported registry file in Notepad and change “open” to “runas” where indicated below:
现在,在记事本中打开导出的注册表文件,并将“打开”更改为“ runas”,如下所示:
Double-click on the file to enter the information into the registry. Now you’ll see that the “runas” section is identical to the “open” section:
双击文件以将信息输入注册表。 现在,您将看到“ runas”部分与“ open”部分相同:
And now you can right-click on a file and open it as administrator:
现在,您可以右键单击文件并以管理员身份打开它:
This example used WinRAR, but this should work for almost any filetype or application. You’ll just have to change where you look in the registry.
此示例使用了WinRAR,但是它几乎适用于任何文件类型或应用程序。 您只需要更改注册表中的位置即可。