|
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:
-
Download and install AlwaysUp, if necessary.
-
Start AlwaysUp.
-
Select Application > Add to open the Add Application window:
-
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.
-
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.
-
To start your exe as a windows service, choose Application > Start "AutoHotkey Executable". The state should transition to Running momentarily:
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:
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...
-
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!
|
Over 87,000 installations, and counting!
|
 |
|
Rock-solid for the past 16+ years!
|
Fully Compatible with 140+ Applications...
|