Subscribe to How-To Geek

Add "Run as Administrator" to Any File Type in Windows 7 or Vista

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?

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.

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)

HKEY_CLASSES_ROOT\.zip

image

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)

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.

image

Now open up the exported registry file in Notepad and change “open” to “runas” where indicated below:

image

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:

image

And now you can right-click on a file and open it as administrator:

image

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.

| More
This article was originally written on 03/10/08 Tagged with: Managing Files and Folders, Windows 7, Windows 7 Tips, Windows Vista

Daily Email Updates

You can get our how-to articles in your inbox each day for free. Just enter your name and email below:


Name:
Email:

Comments (20)

  1. timothy

    Great writeup!

    I just created the keys manually instead of exporting them into a file, and it worked that way perfectly. Thanks!

  2. jd2066

    Creating the keys manually will work too only if the type is “REG_SZ”.
    If the default open key is of type “REG_EXPAND_SZ” you have to do that way with the export or use a registry editor that can create keys with a default value of the type “REG_EXPAND_SZ”.
    Most all Microsoft software uses keys of the type “REG_EXPAND_SZ” for the program path.

  3. Gene Thomas

    I don’t get it. You say, “Have you ever tried to unzip a file to the Program Files directory in Vista? You’ll get all sorts of permission denied errors, and generally be unsuccessful.” But I have never had that problem. Generally, I use 7-zip, but the vista installed wizard works too.

  4. The Geek

    @Gene

    If you have UAC disabled you might not get any errors.

  5. jd2066

    Also I don’t think this tip is needed with the builtin Vista zip utility.
    I think it supports UAC just fine.

  6. jd2066

    One other thing to add, if you use a program like 7-Zip with UAC on in Vista without Administrator access and you don’t get permission denied errors then the write likely got redirected to “C:\Users\[UserName]\AppData\Local\VirtualStore\Program Files” instead of “C:\Program Files”.
    If you are the only user of the computer this doesn’t really matter as Vista will make the files in the VirtualStore folder appear to programs as if they really exist in C:\.
    The problem comes if you want something to appear in “C:\Program Files” for all users.

  7. Ryan

    Very useful – anyone know of annything similar for XP?

  8. vinay

    hello buddy…….is there any registy editing by which i can always run a program as administrator????

  9. jd2066

    There isn’t a registry setting but you can go the properties of a shortcut to a program and on the compatibility tab tell it to “Run As Administrator”.
    That will make it always run as administrator.

  10. Ken

    Thanks, this has been driving me crazy.

    Your instructions where perfect and the solution works great.

  11. Jhony

    Hi…I have a little problem…I have a .bat file I configured to renew my IP but it only works if I run it as an administrator…ok..that’s fine, I can right click-run as administrator…it will work….BUT
    i need it to run AUTOMATICALLY because I always leave my pc on the whole night and after one download I need to renew my ip adress..but i can’t be there (i’m sleeping) :)
    my cuestion is…can i ENABLE the box that says…ALWAYS RUN AS ADMINISTRATOR….????? When I go to properties of the .bat file and then to compabillity in the bottom there is a box that says Always run as administrator but i can’t check it….PLEASE HELP!!!!
    ps: Sorry for my english, I’m from Colombia, 16 years old 6-6-08
    Thank You

  12. nightsurfer

    Great !!!

  13. Luke Davidson

    how do you get the file to notepad and then back to registry editor

  14. Rezmuk87

    right click the notepad file, open with…, regeditor

  15. Dave

    For some reason Vista gives me an “access denied” when I try to open Documents and settings. Right clicking-properties- does not have a “run as admin” selection. I need to get in there to edit some things. I am the administrator but occassionally, when I try to delete an exe file I also get the error “you are not authorized to delete this file”. In most cases this is simply a program I installed and now want to delete. It is not something that shows up in the control panel delete programs. How can I get around this dumb thing that will not let me do as I please on my computer?? I am not tryig to alter any system files.

    Dave

  16. patti

    I need to access some files on another hard drive but it keeps saying, access denied.. I need the files to finish some work.. can you help..

  17. Kevin

    Seriously great tip. ;-)

  18. Joseph

    It’s good, but msn is so messed up for me. When i click run as admin nothing happens, and when i open it up normally data execution closes it. And then when i go to compatability i’m not able to make it run as admin permanetly.

  19. ken

    Brilliant guide!!! thank you so much!

  20. rod

    does not work with win 7


Leave a Comment




Leave your friendly comment here.

If you have a computer help question, click here to leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Our Friends
Getting Started


About How-To Geek
What Is That Process?
svchost.exe
jusched.exe
dwm.exe
ctfmon.exe
wmpnetwk.exe
mDNSResponder.exe
wmpnscfg.exe
rundll32.exe
wfcrun32.exe
Ipoint.exe
Itype.exe
Wfica32.exe
Mobsync.exe
conhost.exe
Dpupdchk.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. All Rights Reserved.