With a simple trick, you can run an AutoHotKey script on startup in Windows. It is pretty easy to do.
AutoHotKey is one of my favorite software. In fact, I use it daily and have a fair number of custom shortcuts, macros, and text expansions that make my Windows experience that much more pleasant. The best thing is that, depending on your use case, creating an AutoHotKey script is easy and fast.
To get the most out of an AutoHotKey script, running it on startup is essential. That way, the script runs automatically and gives you instant access from the get-go.
There are two ways to run an AutoHotKey script on startup in Windows. The first method is quite easy to follow, and the second is useful if you want more control over how and when the AutoHotKey script runs on startup.
Table of contents:
Note: I assume that you already have an AutoHotKey script ready.
The steps below work the same in Windows 10 and 11.
Add AutoHotKey script to the startup folder
You can add the AutoHotKey script shortcut to the Windows Startup folder to run it on system startup. In fact, you can add any application shortcut to this folder to run it on startup. Let me show you how.
- Open the File Explorer.
- Go to the folder where the script is saved.
- Right-click on the AutoHotKey script.
- Choose the “Send to -> Desktop” option.
- It will create a shortcut for the script on the desktop.
- Go to the desktop and copy the shortcut.
- Press “Win + R” to open Run.
- Type “shell:startup” in the blank field.
- Press “Ok.”
- Paste the copied AutoHotKey script shortcut.
- Close File Explorer.
- With that, the AutoHotKey script now runs on startup in Windows.
Steps with more details:
First, we can only add shortcuts to the startup folder; we need to create a shortcut for the AutoHotKey script. To do that, open the File Explorer with the “Win + E” shortcut and go to where the AutoHotKey script is saved. Next, select the AutoHotKey script, hold the “Alt” key on your keyboard, and drag and drop it into the same folder.
The above action will instantly create a shortcut of the script file in the same folder. It is optional, but you can remove the “.ahk – shortcut” suffix from the shortcut name.
Note: You can also create a shortcut by right-clicking the script file and selecting the “Send to -> Desktop” option. The shortcut will be created on the desktop.
After creating the shortcut, copy it. You can select the shortcut file and press the “Ctrl + C” shortcut. We are going to paste it into the startup folder.
Now, we need to open the Startup folder. So, press the “Win + R” to open the Run dialog box. Type the shell command
shell:startup in the blank field and click the “Ok” button.
The run dialog box immediately opens the Windows Startup folder. Press the “Ctrl + V” shortcut to paste the copied shortcut file in the Startup folder. You can also drag and drop the shortcut file into the startup folder.
That is all. From now on, the AutoHotKey script will automatically start with Windows. You no longer have to launch the script manually.
Schedule AutoHotKey script with Task Scheduler
You can use the Task Scheduler if you want more control over how a program starts with Windows. For example, this method is useful to delay start a program. Let me show you how to schedule and run an AutoHotKey script on startup in Windows.
- Press the “Start” key.
- Search and open “Task Scheduler.”
- Click “Create Basic Task.”
- Type a name in the “Name” field.
- Click “Next.”
- Select “When I log on.”
- Press “Next.”
- Choose “Start a program.”
- Click “Next.”
- Type the below path in the “Program/Script” field.
- Type the AHK script file path in the “Arguments” field.
- Press the “Finish” button.
- Close the Task Scheduler.
- With that, you’ve scheduled an AutoHotKey script to run on startup.
Steps with more details:
First, open the start menu, search for “Task Scheduler,” and click on the result to open it.
After opening the Task Scheduler, select the “Create Basic Task” option on the right sidebar.
Give the new task a name using the “Name” field and press the “Next” button to continue.
Since we want to run the AutoHotKey script on startup, select the “When I log on” radio option and click “Next.”
Select the “Start a program” radio option and press “Next.”
Type the following file path in the “Program/script” field. After that, enter the AutoHotKey script file (.ahk) path in the “Arguments” field. Press the “Next” button.
Note: If you’ve installed AutoHotKey in another location, modify the path below accordingly. You can also click the “Browse” button next to the “Program/script” field and select the “AutoHotKey.exe” file.
Review your settings and click the “Finish” button to complete the task creation process.
Finally, find the newly created task in the main window, right-click, select “Run,” and see if the job runs successfully. If it did not run as expected, review the steps.
That is all. From now on, the AutoHotKey script will run on startup in Windows.
As you can see, running an AutoHotKey script at Windows startup is pretty easy.
I hope this simple and easy Windows how-to guide helped you.
If you are stuck or need help, send an email, and I will try to help as much as possible.
If you like this article, check out how to create a right-hand alt-tab shortcut and how to run portable apps at system startup.