Run AutoHotkey as a Windows Service with AlwaysUp

How to Run AutoHotkey as a Windows Service with AlwaysUp

Start your complied AutoHotkey executable as soon as your PC boots and keep it running 24x7 in the background

AutoHotkey is a free a scripting language and toolkit for desktop automation.

While Session 0 Isolation strongly discourages GUI interaction from a windows service, at least one of our customers needed to run an AutoHotkey script in Session 0 to support a legacy application.

To setup AutoHotkey to run as a Windows Service with AlwaysUp:

  1. Download and install AlwaysUp, if necessary.

  2. Start AlwaysUp.

  3. Select Application > Add to open the Add Application window:

    Add Application

  4. On the General tab:

    • In the Application field, enter the full path to your compiled AutoHotkey executable. In this tutorial, we are running the simple text editor with menu bar example, compiled into an executable called AHKSampleTextEditor.exe.

    • In the Name field, enter the name that you will call your application in AlwaysUp. We have used AutoHotkey Executable but you can specify virtually anything you like.

    • If you have any command line parameters for your AutoHotkey executable, enter those in the Arguments field. Our sample takes no parameters so we will leave that section blank in this tutorial.

    AutoHotkey Windows Service: General Tab

  5. Click the Save button to record your settings. In a couple of seconds, an application called AutoHotkey Executable (or whatever you called it) will appear in the AlwaysUp window. It is not yet running though.

    AutoHotkey Windows Service: Created

  6. To start your exe as a windows service, choose Application > Start "AutoHotkey Executable". The state should transition to Running momentarily:

    AutoHotkey Windows Service: Running

    On Windows 8.1/8/7/Vista and Server 2012/2008, your executable will be running in the background on the isolated Session 0. Select Tools > Switch to Session 0... to see any windows that your executable created:

    AutoHotkey Windows Service: Running in Session 0

    You can also select Application > Restart "AutoHotkey Executable" in this session to quickly stop your AutoHotkey executable and start it again on your desktop.

    Or setup automatic login to get around Session 0 isolation...

  7. That's it. Next time your computer boots, your AutoHotkey executable will start before anyone logs on.

    As noted before, GUI applications may sometimes run into trouble when run as a windows service. Proceed cautiously and test thoroughly!

    And finally, we encourage you to edit the application in AlwaysUp and check out the many other settings that may be appropriate for your environment. The 70+ page user's manual (PDF) describes them all.

AutoHotkey not working properly as a Windows Service?

  • Consult the AlwaysUp Troubleshooter — our online tool that can help you resolve the most common problems encountered when running an application as a Windows Service.

  • From AlwaysUp, select Application > Report Activity > Today... to bring up a HTML report detailing the interaction between AlwaysUp and your AutoHotkey executable. The AlwaysUp Event Log Messages page explains the more obscure messages.

  • Browse the AlwaysUp FAQ for answers to commonly asked questions and troubleshooting tips.

  • Contact us and we will be happy to help!

Download & Try it Free!

Download AlwaysUp and Run as a Service Today! Version 15.1

7.9 MB Installer
Our 12,000+ customers include...
Compatible with Windows 11 Compatible with Windows Server 2022 Compatible with Windows 10
Over 94,000 installations, and counting!
AlwaysUp is number 1! Run as a Service with AlwaysUp

Rock-solid for the past 19+ years!