LIVEReading: Automate Windows Tasks With AutoHotkey ScriptsTotal time: 7 minSteps: 6Worked first time: 88% LIVEReading: Automate Windows Tasks With AutoHotkey ScriptsTotal time: 7 minSteps: 6Worked first time: 88%
CBW
Automate Windows Tasks With AutoHotkey Scripts
Easygithub.com/AutoHotkey/AutoHotkey2026-07-11

Automate Windows Tasks With AutoHotkey Scripts

AutoHotkey lets you automate repetitive Windows tasks using simple scripts — remap keys, auto-fill text, click buttons automatically. No coding background needed to run pre-made scripts.

// Build stats

  • Total time7 min
  • Number of steps6
  • DifficultyEasy
  • Worked first time88%
// Before you start

What you need

  • Windows 10 or 11 (AutoHotkey is Windows-only)
  • Ability to download and run an installer
  • A text editor (Notepad works fine)
01
Step 1 of 6

Download and install AutoHotkey v2

3 min

You do not need to compile anything from the GitHub source code. AutoHotkey provides a ready-made installer on its official website. Download and run it like any normal Windows program. Choose the default options when prompted.

Terminal · mac
$ Start-Process 'https://www.autohotkey.com/download/ahk-v2.exe'
What you should see
An installer window opens. Click through the prompts and AutoHotkey installs silently. You will see an AutoHotkey icon in your system tray or Start menu when done.
This might happen

Windows Defender or your antivirus flags the installer as suspicious.

This is a known false positive with AutoHotkey. The official AutoHotkey site documents this at autohotkey.com/download. Download only from autohotkey.com and allow the installer to run.

02
Step 2 of 6

Create your first script file

2 min

An AutoHotkey script is just a plain text file with the extension .ahk. Right-click your Desktop, choose New, and if AutoHotkey installed correctly you will see 'AutoHotkey Script' in the menu. Click it. A file called 'New AutoHotkey Script.ahk' appears on your Desktop. Rename it to something like 'MyAutomation.ahk'.

Terminal · mac
$ Right-click Desktop → New → AutoHotkey Script
What you should see
A new .ahk file appears on your Desktop with the AutoHotkey green H icon.
This might happen

'AutoHotkey Script' does not appear in the right-click New menu.

Open Notepad, save an empty file with the name MyAutomation.ahk (change 'Save as type' to 'All Files'). That works the same way.

03
Step 3 of 6

Add a simple automation to the script

3 min

Right-click your .ahk file and choose 'Edit Script' (or open it in Notepad). Delete any existing text and paste the example below. This script does two things: pressing Ctrl+Alt+H types 'Hello, World!' wherever your cursor is, and pressing Ctrl+Alt+Q quits the script. Save the file when done.

Terminal · mac
$ ; Press Ctrl+Alt+H to type a greeting
$ ^!h::
$ {
$ SendText('Hello, World!')
$ }
$
$ ; Press Ctrl+Alt+Q to exit the script
$ ^!q::
$ {
$ ExitApp()
$ }
What you should see
The file saves with no errors. It is still just a text file at this point — nothing runs yet.
This might happen

The file saves as MyAutomation.ahk.txt instead of .ahk.

In Notepad, set 'Save as type' to 'All Files' before saving, or rename the file and delete the .txt extension in File Explorer (enable 'File name extensions' in the View menu first).

04
Step 4 of 6

Run the script

1 min

Double-click your .ahk file to run it. AutoHotkey loads the script in the background — you will see a small green H icon appear in the Windows system tray (bottom-right corner near the clock). The script is now active and listening for your hotkeys.

Terminal · mac
$ Double-click MyAutomation.ahk
What you should see
A green H icon appears in the system tray. No window opens — that is normal. The script is running silently.
This might happen

Double-clicking opens the file in Notepad instead of running it.

Right-click the file and choose 'Run Script'. If that option is missing, right-click → Open with → AutoHotkey.

05
Step 5 of 6

Test your hotkeys

1 min

Open Notepad or any text field. Press Ctrl+Alt+H on your keyboard. The words 'Hello, World!' should appear instantly as if you typed them. Press Ctrl+Alt+Q to stop the script. The green H icon disappears from the tray when the script exits.

Terminal · mac
$ Press Ctrl + Alt + H (with a text field focused)
What you should see
The text 'Hello, World!' is typed automatically at your cursor position.
This might happen

Nothing happens when you press the hotkey.

Make sure the green H icon is visible in the system tray — if not, the script is not running. Also check that another program is not already using Ctrl+Alt+H. Try a different hotkey combination in the script.

06
Step 6 of 6

Make the script run automatically at startup

2 min

If you want your automation to start every time Windows boots, place a shortcut to your .ahk file in the Windows Startup folder. The command below opens that folder directly. Then drag your .ahk file into it while holding Alt to create a shortcut there.

Terminal · mac
$ shell:startup
What you should see
The Startup folder opens in File Explorer. After placing a shortcut there, your script will run automatically every time you log in to Windows.
This might happen

You are not sure how to open the Startup folder with that command.

Press Windows+R to open the Run dialog, type shell:startup, and press Enter. The folder opens immediately.

// Status

cooked. baked. worked.

AutoHotkey is installed and running a live script that responds to custom keyboard shortcuts. You have a foundation to add more hotkeys and automations by editing the .ahk file.

// the honest bit

The honest part

This guide covers running pre-written scripts only — it does not teach you to write complex automations from scratch. The AutoHotkey scripting language has hundreds of commands; the community forum at autohotkey.com/boards is the best place to find ready-made scripts for common tasks. Also note: AutoHotkey is Windows-only and will not work on Mac or Linux. Some corporate IT policies block AutoHotkey from running.