How To Add “Run as Administrator” in Windows 7 or Vista

Hello lovely people 😉

We are huge fans of using AutoHotkey which allows us to automate our entire computing experience… but in Windows Vista and Windows 7 there are serious limitations since you cannot run a script as Administrator by default. This means that your hotkeys cannot interact with Windows running in Admin mode… so how do we get around this? This is what this computer repairs tip is all about…

There are three solutions to this problem:

  • We can completely Disable UAC – Not the best solution for security purposes, but it works.
  • Compile our script to an executable.
  • Hack the registry and add “Run as Administrator” to the context menu.

How to compile script as executable

To achieve this you just have to right-click on the script and choose “Compile Script”…

How To Add "Run as Administrator" in Windows 7 or Vista 1

And now you are able to run the executable version as administrator:

How To Add "Run as Administrator" in Windows 7 or Vista 2

However this really isn’t the perfect solution. We edit our script all the time, so having to recompile every time we need to make an edit gets very annoying.

Here is the Manual Registry Hack for AutoHotkey “Run as Administrator”

Open up regedit through the start menu search or run box, and then browse down to the following key:

HKEY_CLASSES_ROOTAutoHotkeyScriptShell

How To Add "Run as Administrator" in Windows 7 or Vista 3

Right-click on “Shell” on the left-hand side and create a new key called “runas”, then create a key called “Command” underneath it. Then set or create the following two values on the right-hand side, adjusting the path if necessary.

Name

Value

(Default)

“C:Program FilesAutoHotkeyAutoHotkey.exe” “%1″ %*

IsolatedCommand

“C:Program FilesAutoHotkeyAutoHotkey.exe” “%1″ %*

The default key should already be there, you just need to set the value.

Now when you right-click on an AutoHotkey script, you’ll see the option to Run as Administrator when you right-click on an AutoHotkey script

How To Add "Run as Administrator" in Windows 7 or Vista 4

Over and out

Your private computer repairs technician

MobileGeekette

Call Now Button1300 883 021