My 10 Favorite AutoHotKey Scripts to Make Life Easier

My 10 Favorite AutoHotKey Scripts to Make Life Easier

AutoHotKey is one of the best Windows automation programs that can perform the simplest of actions to the hardest of tasks. In case you don’t know, AutoHotKey is a free and open-source program which uses its own scripting language to automate any of your daily Windows tasks. Even though the “scripting language” sounds intimidating, it is very easy to use, and you can do all sorts of cool things.

Let me share my favorite and most-used AutoHotKey scripts which make my daily tasks a little bit easier and that may help you.

Before starting, I assume that you already know how to install and configure AutoHotKey. Moreover, please note that the lines starting with ; are comments.

1. Repurpose Those Function Keys

Most of us hardly ever use the function keys on our keyboard, except for F2 (rename), F5 (refresh), and F11 (full screen in the browser). Using AutoHotKey, you can repurpose those unused functions to do a variety of things like launching web pages, launching programs, etc. For instance, I use the function keys to launch my most used programs like Snagit, Sublime Text, Photoshop, Calculator, Thunderbird, etc.

To launch a program, simply use the script below. Don’t forget to replace the program path with your favorite program.

2. Open Webpages Quickly

Just like launching your favorite programs, you can create your own custom shortcuts to launch your favorite websites. For instance, I use “Ctrl + Shift + T” to launch MakeTechEasier. Use the following script to launch your favorite web page. Don’t forget to replace the web address with your favorite site.

Just like the one above, you can create you own shortcuts using a combination of ctrl(^), shift(+), alt(!), and win(#) keys.

3. Open Favorite Folders

Along with opening web pages and programs, you can also open your most-used folders with just a simple shortcut. For instance, most of us access the Downloads folder often, and to make it easier we can use a simple script like the one below. You can customize the script to change the shortcut and the folder path according to your needs.

4. Move Up a Folder in File Explorer

When you are in a folder, you often need to move up one folder. In previous versions of Windows, the backspace key has done the job. But now the backspace key moves you back in history. This is useful to many, but I still hate to click on that little icon to move up a folder. So I use the below script to move up a folder by clicking the middle mouse button.

If you want to, you can also reconfigure the useless tilde (~) key on your keyboard to do the same action.


5. Adjusting Volume

Even though it doesn’t have any multimedia keys, I love my keyboard, but the lack of volume control buttons is a bit uncomfortable for me. So I use the following script to control the volume of my system.


6. Set Default State of Lock Keys

Using AutoHotKey, you can easily set the default or permanent state of the lock keys on our keyboard. e.g. Caps Lock to be turned off, Num Lock to be turned on and Scroll Lock to be turned off. This simple script is so helpful, and even if you press them accidentally, the lock state won’t change.

7. Reconfigure Caps Lock

After turning off the Caps Lock, you might want to reconfigure it to act as the Shift key. To reconfigure the Caps Lock key, use the below script.

8. Empty Recycle Bin

You can use the below script to quickly empty the trash bin. This simple script saves me from using my mouse to do that same task.


9. Window Always on Top

Sometimes you just want a window to be always on top no matter which window you are working on or is in focus. For instance, when working on a spreadsheet, you might access the calculator app frequently and having it on top of the spreadsheet is quite handy. Using AutoHotKey, you can easily do this with a single line of code.

The script was originally published by labnol.

10. Temporarily Suspend AutoHotKey

The shortcuts created using AutoHotKey may sometimes interfere with some programs. In those cases you can temporarily disable AutoHotKey using the below script. Of course, if you don’t want to use a shortcut, then simply right-click on the AutoHotKey icon in the taskbar and select the option “Suspend Hotkeys.”


As you can see, all the scripts shared above are basic but do make things easier. Besides the easy stuff, you can do all sorts of complicated things like automatically send emails, manage programs, automate certain Windows tasks, automatically correct spellings, etc.

I hope the above scripts help you. If you are using AutoHotKey, then do share your favorite scripts in the comments form below. I’m so looking forward to it.

The Complete Windows 10 Customization Guide

The Complete Windows 10 Customization Guide

In this ebook we’ll be exploring the multitude of options to fully customize Windows 10. By the end of this ebook you’ll know how to make Windows 10 your own and become an expert Windows 10 user.

Get it now! More ebooks »


  1. Hi

    One or two numeric keys are not working in my key board properly. How can I assign these numbers to the useless function keys; thanks

    1. Say if the “8” key on your Numpad is not working, then you can easily assign that number to any of the functions keys using this single line of code.


      Change the code according to your needs.

  2. When I do a FIND on a comment in Excel it only finds the comment that contains the string I’m seeking. Is it possible to write an AUTOHOTKEY script that would highlight the line within the comment as well? Some of my comments are very long and just pointing to the hosting comment still means I have a lot of searching to do within it.

    1. It can be done in more ways than one but here is my take on how you can do it

      [code]#IfWinActive, ahk_exe EXCEL.EXE

      xlComments = -4144
      xlPart = 2
      xlByRows = 1
      xlNext = 1

      oExcel := ComObjActive(“Excel.Application”)
      oWorkbook := oExcel.activeWorkbook

      cell := oExcel.range(“A1:f6″).Find(What:=”more”,, LookIn:=xlComments, LookAt :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= False, SearchFormat:=False )

      Comment := cell.Comment
      Comment_text := Comment.Text

      if (pos := RegExMatch(Comment_text, what))
      what_length := StrLen(what)
      Comment_length := StrLen(Comment_text)
      Move_length := Comment_length – (pos + what_length)
      Comment.Visible := true

      sleep 200

      ControlGet, hwnd, hwnd, , Excel71, ahk_exe EXCEL.EXE
      ControlSend,, {left %Move_length%}+{left %What_length%}, ahk_id %hwnd%


      If you’d like me to help you modify this in anyway you are welcome to contact me on my Autohotkey website

      1. Jackie,
        Thanks very much for your script. I’ll be certain to take you up on your generous offer to use you as a resource should I get stuck getting started using autohotkey – just signed up for your newsletter!

  3. How to empty the trashbin with CCleaner, is that possible?

  4. Actually #3 is rather disingenuous: If you drag & drop a folder to the explorer icon on your taskbar, it creates a shortcut for it in the right-click menu: You can make more of them and IMO easier/more logical accessible than repurposing a function key…

  5. Nice list of useful Autohotkey routines :)

    I also made a similar called “7 Incredibly Simple Ways for You to Save Time Using AutoHotkey” found here
    That list also has an item about opening program with a single keypress and other great uses

    Have even more in my post “Autohotkey tricks to be more productive”

    PS: What are you using to syntax highlight you code?

    1. The syntax highlight looks strongly reminiscent of notepad++ ( Another great, free program.

  6. I would add to the third example (Open Favorite Folders):

    The folder won’t open if the path name contains an AutoHotkey special meaning character; ( `) ( % ) ( , ) and ( ; ). These special characters need to be escaped with a backtick ( `). For example,

    ^+d::Run “C:\Users\Vamsi\Downloads%today”

    must be converted to,

    ^+d::Run “C:\Users\Vamsi\Downloads`%today”

    Tip: The keyboard hotkeys are just perfect to open few folders. You could find the Enterpad hotkeys useful if you have many of them:

Comments are closed.