AutoHotkey Lesson 1: Install AutoHotkey v2 and Your First Hotkey

📎 This article includes 1 downloadable practice file ↓

⏱ 1 min read

📘 AutoHotkey Beginner Course · Lesson 1 of 6

In this article
  1. Install
  2. First script
  3. Where people go wrong
  4. Practice

AutoHotkey (AHK) lets you create your own keyboard shortcuts for anything on Windows. It’s free and the scripts are plain text files.

Install

Download AutoHotkey v2 from autohotkey.com and install it. Version 2 is current; many old scripts online are v1 and won’t run without changes.

First script

#Requires AutoHotkey v2.0
#n::Run "notepad.exe"                ; Win+N opens Notepad
^!t::MsgBox "It is " FormatTime(, "HH:mm")   ; Ctrl+Alt+T

Save as my-keys.ahk and double-click it. A green “H” icon appears in the system tray; right-click it to Reload, Edit or Exit.

Symbol Key
# Windows
^ Ctrl
! Alt
+ Shift
💡 Put a shortcut to your script in the Startup folder (Win+R, shell:startup) so your hotkeys are always available after login.

Where people go wrong

Problem Cause
Errors in scripts from the web They’re v1; look for v2 versions
Hotkey does nothing Another app uses it; choose another combination

Practice

Download the script, run it, and try Win+N and Ctrl+Alt+T. Add one hotkey of your own.

📎 Practice files for this article

  • ⌨️
    Lesson 1 script (AutoHotkey v2)Double-click to run after installing AutoHotkey v2.
    ⬇ AHK · 249 B

Free to use for learning. Files with macros (.bas) are plain text — import them with Alt+F11 → File → Import File, and always test on a copy.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong