What is an AHK File?

How to Open, Edit, & Convert AHK Files

Picture of the AutoHotkey program icon

A file with the AHK file extension is an AutoHotkey Script file. It's a plain text file type that's used by AutoHotkey, a free scripting tool for automating tasks in Windows.

The AutoHotkey software can use the AHK file to automate things like clicking window prompts, typing out letters and numbers, and more. It's especially useful for long, drawn out, and repetitive actions that always follow the same steps.

How To Open an AHK File

Even though AHK files are just text files, they're only understood and executed within the context of the free AutoHotkey program. This program must be installed in order to open an AHK file to perform some task. So long as the syntax is correct, the software understands what's written in the AHK file as a series of commands that AutoHotkey should follow.

Important: Take extra care to only use executable files like AHK files that you've made yourself or that you've downloaded from a trusted source. The moment an AHK file exists on a computer that has AutoHotkey installed is the moment you put your computer at risk. The file may contain harmful scripts that could do lots of damage to both your personal files as well as to important system files.

Note: The AutoHotkey download page contains both the full installer version of the software as well as portable options for both 32-bit and 64-bit versions of Windows.

All that said, because AHK files are written in plain text, any text editor (like Notepad in Windows or the free Notepad++ I often recommend) can be used to build the steps and make changes to existing AHK files. Again, though, the AutoHotkey program must be installed to make the commands included in the text file actually do something.

This means if you make an AHK file on your computer and it works fine with AutoHotkey installed, you can not send that same AHK file to someone else who does not have the software installed and expect it to work for them too. That is, of course, unless you convert the AHK file to an EXE file, which I talk about in the section below.

Note: It may not seem like you've opened an AHK file if the instructions inside the file don't do something obvious. For example, if your AHK file is setup to just type out a sentence after you've entered a special combination of keyboard commands, then opening that specific AHK file won't reveal any window or indication that it's running. However, you'll for sure know you've opened one if it's configured to open other programs, shut down your computer, etc. - something obvious.

However, all open scripts are shown in Task Manager as AutoHotkey, as well as in the notification area of the Windows taskbar. So if you're not sure whether an AHK file is currently running in the background, be sure to check those areas.

How To Convert an AHK File

AHK files can be converted to EXE so that they can run without having to explicitly install the AutoHotkey software. You can read more about converting AHK to EXE on the company's Convert a Script to an EXE (ahk2exe) page.

Basically, the quickest way to do that is to right-click the AHK file and choose the Compile Script option. You can also convert the AHK file through the Ahk2Exe program included in the installation folder of AutoHotkey (you can search for it through the Start menu or one of these search tools), which also lets you choose a custom icon file.

AutoIt is a program that's similar to AutoHotkey but uses the AUT and AU3 file formats instead of AHK. I don't know of any easy way to convert an AHK file to AU3/AUT, so you may have to completely rewrite the script in AutoIt if this is what you're after.

More Help with AHK Files

See Get More Help for information about contacting me on social networks or via email, posting on tech support forums, and more.

Let me know what kinds of problems you're having with opening or using the AHK file and I'll see what I can do to help.