AutoHotkey scripts command line execution

Execute AutoHotkey Scripts from Command Line

I struggled to figure out how to execute AutoHotkey scripts from the command line, so here's a memo. In conclusion, for PowerShell, this is how you do it. AutoHotkey doesn't automatically add itself to PATH, so you either have to do it manually, or if you're lazy, you have no choice but to use the full path.

Shou Arisaka
1 min read
Oct 9, 2025

I struggled to figure out how to execute AutoHotkey scripts from the command line, so here’s a memo.

In conclusion, for PowerShell, this is how you do it:

. "C:\Program Files\AutoHotkey\AutoHotkeyU64.exe" .\script.ahk

AutoHotkey doesn’t automatically add itself to PATH, so you either have to do it manually, or if you’re lazy, you have no choice but to use the full path.

You could add it to PATH, but if you specify and execute with the full path, it would be like this:

The key points are that “C:\Program Files\AutoHotkey\AutoHotkey.exe” doesn’t work, and that you need to put . at the beginning.

If you add it to PATH, you can execute with autohotkey script.ahk which is convenient and recommended. But well, if you can’t even execute with the full path in the first place, there’s no way to add it to PATH.

Share this article

Shou Arisaka Oct 9, 2025

🔗 Copy Links