Running Autohotkey Script With Admin Rights_thumb.jpg 1If you are using Autohotkey to write scripts for Windows 7 and you are annoyed that you are still prompted by UAC for elevated rights then here’s the solution.

Previous parts:
Part 1 What Is Autohotkey

Click here to join Ultra.io - Rare NFTs and Play-to-Earn Games or Read my review first!

Part 2 Assign String To Keyboard Button

Compiling AHK<&h3>

1. Step Go to your AHK script file and right click on it, then select Compile
Compile Ahk Script 1

2. Step As you can see in the picture, a green “idletimelaunch.exe” will appear.

3. Step Right-click on the .exe file and click on Properties

4. Step Go to the tab Compatibility and at the bottom check the box Run this program as an administrator (Privilege Level)

Run This Autohotkey Script As Administrator 1

5. Step Hit Apply and you can now execute this .exe file and all commands that you are running in your AHK script will be executed with admin privileges

EXAMPLE: How to run bat file with admin privileges:

Let’s say you wanted to run a batch file with admin rights e.g. a backup batch that requires elevated rights. Normally AHK would throw out a UAC prompt when you add this code:

Run C:\Users\sOliver\Documents\Useful.bat

However, when you compile the script and check the box Run as admin as described above it will work just fine. Just perfect for an unattended backup batch file.

I hope this will help some of the AutoHotkey newbies out there.