AutoHotkey guides

These guides cover the parts around the code: getting the interpreter onto a machine, keeping scripts running, and working out what to do when one of them stops behaving.

Installed or portable

The regular installer registers the .ahk file type, so double-clicking a script just works. A portable setup keeps the interpreter in a folder you carry with you — on a USB drive or a synced directory — and touches nothing else on the machine. Searches for AHK portable and portable AutoHotkey are usually after that second option.

InstalledPortable
File associationRegisteredNone — launch through the executable
Admin rightsNeeded to installNot needed
Good forYour own PCLocked-down or shared machines

To run a script portably, call the interpreter with the script path:

AutoHotkey64.exe "D:\ahk\clipboard.ahk"

Starting scripts with Windows

Press Win+R, enter shell:startup, and drop a shortcut to your script in the folder that opens. For a script that needs administrator rights, create a Task Scheduler entry set to run with highest privileges at logon instead.

Elevation and blocked input

A script running as a standard user cannot send keystrokes to a window running as administrator. If a hotkey works everywhere except in one program, that is almost always the reason. Run the script elevated and try again.

Errors you will meet

MessageUsual cause
This line does not contain a recognized actionv1 syntax running under v2 — see the v2 guide
Target window not foundThe window title changed, or the script acted before it appeared
Call to a non-existent functionTypo, or a function that was renamed between versions
Nothing happens at allAnother program owns the key combination

Keeping a script collection tidy

One file per purpose, a comment header on each, and a single folder for all of them. When two scripts want the same hotkey, whichever loaded last wins — a good reason to keep the list short.

Related reading: tutorials for the basics, Windows automation for larger jobs, and the FAQ for quick answers.

Frequently asked questions

Is there a portable version of AutoHotkey?

Yes. A portable setup keeps the interpreter in its own folder and runs scripts by passing the file path to the executable, with no installation required.

How do I run an AHK script at startup?

Put a shortcut to the script in the shell:startup folder, or schedule it at logon if it needs administrator rights.

Why does my hotkey work everywhere except one program?

That program is probably running as administrator, so it ignores input from a non-elevated script.


AutoHotkeyTools.com is an independent Windows resource covering AutoHotkey tools, scripts, hotkeys, tutorials and desktop automation. It is not affiliated with the AutoHotkey project.