10 Cool AutoHotkey Scripts (And How to Make Your Own!) (2023)

Readers like you help support MUO. When you make a purchase using links on our site, we may earn an affiliate commission. Read More.

If you're familiar with the many keyboard shortcuts in Windows and still feel like you need more, it's time to move onto an advanced tool that lets you make your own scripts.

AutoHotkey (AHK) is the answer to your customization needs. This program lets you remap keys, create custom shortcuts, run macros to automate repetitive tasks, and more.

Let's look at some useful AutoHotkey scripts to get you started, along with the basics of the software so you can make your own.

How to Install AutoHotkey

Before you can use cool AHK scripts or make your own, you'll need to install AutoHotkey on your system.

Visit AutoHotkey's homepage, click Download, and choose Download Current Version to grab it. Run through the quick install dialog, and you're ready to start using AutoHotkey scripts.

How to Create New AutoHotkey Scripts

The program you just installed handles the execution of AHK scripts, but it won't do anything until you actually have a script running.

To create a new AutoHotkey script, right-click anywhere on your desktop (or wherever else is convenient) and choose New > AutoHotkey Script. Name it something that makes sense. Then right-click on your new file and choose Edit Script, or open the file in your text editor of choice, to start working on it.

10 Cool AutoHotkey Scripts (And How to Make Your Own!) (1)

Note that you can also open your text editor, type up an AutoHotkey script, and save it as a file ending in .ahk to achieve the same result. Just make sure it has the right file extension!

(Video) How to Automate ANYTHING on your computer using AutoHotKey

Speaking of this, it's a good idea to upgrade your text editor from the basic Notepad. Notepad++ and Visual Studio Code are both great free options.

Now that you have the software to run AutoHotkey scripts, you can download scripts that others have written to take advantage of them without doing any work on your own. To save one, simply download it as an .ahk file and save it wherever you wish.

To run a script, simply double-click on it and it will go into effect. However, you'll probably want some of these scripts to run as soon as you boot your computer so you don't have to start them manually every time.

To do so, copy and paste the .ahk files into your Startup folder. You can get there easily by typing shell:startup into the Start menu. Otherwise, browse to the following location:

 C:\Users\[USERNAME]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
10 Cool AutoHotkey Scripts (And How to Make Your Own!) (2)

Doing this loads your AutoHotkey scripts once you log into your computer.

The Best AutoHotkey Scripts to Try

Here are some of the most useful AutoHotkey scripts you can download and use to improve Windows right away. For even more AutoHotkey script examples, including ones that are much more complex than these, check out the AutoHotkey Script Showcase.

1. AutoCorrect

Even with the precision of a desktop keyboard, you're still bound to make mistakes when typing. And while this is an old AHK script, typos don't go out of style.

Related: How to Enable the Built-In Autocorrect in Windows 10

It contains thousands of common misspellings—when you make a mistake, it instantly replaces your error with the correct word. It even allows you to add your own words, which we'll discuss later.

Download: AutoCorrect Script

2. Disable Lock Keys

The three Lock keys—Num Lock, Caps Lock, and Scroll Lock—aren't used that often in today's computing. You probably use the number pad solely for digits, only hit Caps Lock by accident, and don't even care about Scroll Lock.

(Video) 10 Fast Ways to Make Your Autohotkey Code Faster

If you rarely use these modifiers, try setting them to a default value with this script:

 ; Set Lock keys permanently
SetNumlockState, AlwaysOn
SetCapsLockState, AlwaysOff
SetScrollLockState, AlwaysOff

This assumes you want Num Lock always on. If you prefer it off, just change that line (or remove it completely and only change Caps Lock and Scroll Lock).

3. Re-Purpose Caps Lock

Once you've used the above script to disable Caps Lock, it makes sense to give that key another purpose.

Using this short script will turn Caps Lock into another Shift key, but you can change it to anything you'd like (perhaps another Windows key, if your keyboard only has one of those):

 ; Turn Caps Lock into a Shift key

4. Quickly View or Hide Hidden Files

It's important to know how to view hidden files and folders in Windows at times. If you only need access to hidden folders once in a while and don't want them cluttering up your view normally, this is a useful script.

This script simply has you press Ctrl + F2 with File Explorer open to toggle showing hidden files or folders. That's all there is to it! You'll just need to copy the code from the linked forum post into a script:


    ID := WinExist("A")
WinGetClass,Class, ahk_id %ID%
    WClasses := "CabinetWClass ExploreWClass"
IfInString, WClasses, %Class%
GoSub, Toggle_HiddenFiles_Display
    SubKey = Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
RegRead, HiddenFiles_Status, % RootKey, % SubKey, Hidden
    if HiddenFiles_Status = 2
RegWrite, REG_DWORD, % RootKey, % SubKey, Hidden, 1
RegWrite, REG_DWORD, % RootKey, % SubKey, Hidden, 2
PostMessage, 0x111, 41504,,, ahk_id %ID%

Visit: Toggle Hidden Files Script

5. Quickly Show or Hide Known File Extensions

This one is similar to the above since it deals with File Explorer as well. For security reasons, it's smart to always show file extensions. This makes it easier to spot rogue EXE files masquerading as a PDF, or similar. It's also handy when you need to deal with Windows 10 file associations.

The below script will let you toggle showing extensions for known file types with Win + Y.

Download: Toggle Known File Extensions Script

6. Insert Special Characters

Aside from the few special characters on your keyboard (like @ and *), there are dozens more that aren't so convenient to access. One of the fastest ways to input foreign characters and other uncommon symbols is using AutoHotkey.

(Video) FREE Tool to Automate Your Repetitive and Boring Tasks | AutoHotkey

With just a line of AHK code, you can quickly insert these special symbols and stop having to remember ALT codes, or copying and pasting from an online list.

Use the template below to create shortcuts that are most useful for you. The characters left of the two colons are what you press to trigger the shortcut, while the symbol inside the brackets is what the shortcut inserts.

So for example, if you want to press Alt + Q to insert the trademark icon, you would create a script with this:

 !q::SendInput {™}

For reference, the characters for keys are as follows. You can read more about hotkeys on AutoHotkey's guide page:

  • ^ for Ctrl
  • ! for Alt
  • # for Win
  • + for Shift

7. Run a Quick Google Search

If you're a heavy Google searcher, this handy shortcut lets you run a search for any copied text on your computer.

It will launch your default browser and search Google for any bit of text you have highlighted when you press Ctrl + Shift + C. It's handy to reduce copying and pasting all the time!

Send, ^c
 Sleep 50
Run, https://www.google.com/search?q=%clipboard%

8. Use the Numpad as a Mouse

While you can navigate Windows without a mouse if needed, having this script around means you don't have to remember keyboard shortcuts to do this. This neat AutoHotkey script uses your number pad to act as a mouse, giving you more precision and a way to get around your computer in case of hardware failure.

Have a look at the information at the top of the script for guidance on using it.

Download: Using Keyboard Numpad as a Mouse Script

9. Launch Any App

The Start menu makes it easy to pull up any program installed on your computer in seconds. But for your most-used programs, you might want an even faster way to launch them.

The script to open an app is simple; here's one to launch Firefox when you press Win + F. Change it as needed for your preferred key combo and app.

 #f::Run Firefox

10. Makeshift Volume Keys

Most keyboards have keys to easily change the volume, change the music track, and similar. But in case yours doesn't have these, you can use AutoHotkey to come up with your own volume buttons.

(Video) My greatest, easiest AHK script ever - Instant application switching

Here's one example, which uses Shift + Plus and Shift + Minus (keys on the number pad) to raise and lower the volume. You can also hit the little-used Break key to toggle mute.

As with the other scripts, feel free to adjust the buttons to your liking.

 +NumpadAdd:: Send {Volume_Up}
+NumpadSub:: Send {Volume_Down}
break::Send {Volume_Mute}

Writing Your Own Scripts

If you feel confident, why not try making your own AutoHotkey scripts next? If you're just getting started with AHK, you'll probably benefit the most from text expansion.

Read More: Best Text Expansion Tools for Windows

Essentially, text expansion lets you type a small bit of text that automatically expands to something much longer. If you send the same email multiple times per day, or type out your email address all the time when signing into websites, setting up text expansion will make you more productive.

If you downloaded the AutoCorrect script from #1 above, there's a spot at the bottom for you to add any phrases of your own, which is a perfect place to put some single-line expansion. If you're not using this script, just make a new script for your expansion entries.

It's simple to do: type two colons, followed by the hotkey text. After two more colons, type the phrase you want the shortcut to expand to. So if you wanted to make typing "@@" auto-expand to your email address, the script would be:


The possibilities here are many. You could make the hotkey Ctrl + Alt + C spit out a canned email that you type several times a day, or any number of other tasks pertinent to your work:

Send Hello,{enter}This is a canned email.

Once you've set up some text expansion, you can start remapping keys if you find some of them not useful in their current state.

Do you wish the Insert button was instead a shortcut for Copy, for example? You can change that with the following:


Check out the AutoHotkey tutorials for more info. For a more guided introduction to AHK, we have an AutoHotkey guide for beginners you can also check out.

The Power of AutoHotkey

The great part about AutoHotkey is that it's completely customizable for your needs. If you just want auto-correction and a few simple bits of text expansion, you can easily set that up. If you want to go deeper with lots of custom controls and complex shortcuts, you can write any scripts you please.

(Video) AutoHotkey - Beginners tutorial (All the basic functions)

With these great AutoHotkey scripts, you don't need any coding experience to get started. For a similar tool, you should also look into the basics of Windows batch files.

Image Credit: FabrikaSimf/Shutterstock


1. How to Make Custom Icons for AutoHotkey Scripts
(Walden's Automation)
2. How to Code Your Own Macros | AHK
(Adam Schadow)
3. AutoHotkey - AHK - My fav scripts
(How To Work From Home)
4. AHK is easy to use: AutoHotKey file tutorial
5. Write Your Own Bash Scripts for Automation [Tutorial]
(Null Byte)
6. How to run AutoHotkey scripts at Windows startup - Tutorial
(Anders Jensen)
Top Articles
Latest Posts
Article information

Author: Annamae Dooley

Last Updated: 02/19/2023

Views: 5814

Rating: 4.4 / 5 (65 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Annamae Dooley

Birthday: 2001-07-26

Address: 9687 Tambra Meadow, Bradleyhaven, TN 53219

Phone: +9316045904039

Job: Future Coordinator

Hobby: Archery, Couponing, Poi, Kite flying, Knitting, Rappelling, Baseball

Introduction: My name is Annamae Dooley, I am a witty, quaint, lovely, clever, rich, sparkling, powerful person who loves writing and wants to share my knowledge and understanding with you.