The Core Technologies Blog

Our Software // Windows Services // 24×7 Operation

Wondering if Your Legacy Desktop Application Will Work as a Windows Service? Answer These 3 Questions to Find Out

3 Questions

Does your old (but important) desktop application need to run all the time?

Should it start immediately after a reboot, even when no one is there to log on and kick it off?

If so, you should consider installing your program as a Windows Service — the technology Microsoft invented to support mission-critical, 24×7 applications. Use a “service wrapper” (like our AlwaysUp) to install your application as a service in 5-10 minutes.

But not all legacy applications will operate smoothly when installed as a service. Here are three questions you should ask to determine if a windows service is a good fit for your situation:

  1. Do you need to see (or interact with) your program while it’s running?

    Windows services run in the background. Any windows displayed by a service appear on a “hidden desktop” called Session 0. When your legacy application is running as a service, you will not see its windows on your own desktop.

    As a consequence, it doesn’t make much sense to run an intensively interactive application (like a word processor) as a windows service. Indeed, any application that demands your constant attention will be a poor fit. Does yours?

    But if you only need to see your application from time to time, a service may still be an option because you can quickly switch to the Session 0 desktop whenever you need to see your application.

    For example, when running Apple’s iTunes as a windows service, here is what the Session 0 desktop looks like:

    iTunes as a Windows Service in Session 0

    Even though there is no taskbar and the usual desktop icons have vanished, we can interact with iTunes just fine in Session 0. For example, we were able to add tracks to iTunes, create a playlist, and even change settings — just as we would if iTunes was running on our regular desktop.

    (The only exception is on Windows 10 and Windows 2016, where a particularly annoying bug will prevent you from moving the mouse and keyboard in Session 0. Come on Microsoft! Please fix this defect soon.)

    So is occasionally switching to Session 0 good enough for your situation? If not, you should rule out a windows service.

  2. Will your application occasionally prompt for input?

    An application that periodically pops up windows and expects you to respond can be a problem when installed as a windows service. Those popups/windows will appear on the Session 0 desktop — effectively hidden from you. You will not know that your program is stuck waiting for you to enter a password or click the OK button!

    So a “needy” application is not a great candidate for running in the background as a windows service. Does your legacy application fit the mold?

    However, if you only have to get past one or two prompts, our AlwaysUp service wrapper may provide an elegant solution. Simply write an automation script that dismisses the prompt and plug the script into AlwaysUp. This page dives into the details.

    For example, when launching iTunes as a service, this error message is the first to appear:

    iTunes Startup Error

    Clicking the “X” in the title bar will expel the window and allow iTunes to start. To achieve the same effect when no one is around to click, we provided this simple one-line script (which sends the “ESC” key to the iTunes window) to AlwaysUp. Now AlwaysUp automatically dismisses the warning on our behalf whenever it appears!

  3. Does your application read from or write to files on a network drive?

    Like a regular application, a windows service can access remote/network devices. Permissions are granted based on the account running the service.

    However, a service can’t use a mapped drive — at least not without some extra work to explicitly map the drive letter.

    Mapping a Network Drive

    So if your legacy application references network files via their full UNC path (like “\\ServerName\ShareName\Path”) it will be fine as a windows service. But if your program uses files via a mapped drive (like “J:\Path”, where J is mapped to “\\ServerName\ShareName\”), a service may not be in your future.

    Mapped drives may not be an issue when using AlwaysUp though. Most drives will be mapped and available to your application if you check the “Attempt to automatically reconnect all network drives” box on the Startup tab when configuring your application.

Next step? Try it yourself!

If none of these questions have ruled out your legacy/desktop application, you should go ahead and try it as a windows service. Any service wrapper (like AlwaysUp) will do the trick in a few minutes. What have you got to lose?

Posted in Windows Services | Tagged , , , | Leave a comment

Q & A: Why does Dropbox Stop Syncing my Files?

Q & A

We are currently using AlwaysUp for one of our customers to run Dropbox (inside a terminal server). Lately we have been having an issue where items stop syncing to Dropbox however AlwaysUp says the state is running. In order to get this working again we need to restart the Dropbox service using AlwaysUp. Any support would be appreciated.

— Fulton @ Logical Solutions

Hi Fulton. Based on what we have seen with other customers, these are the likely culprits:

Dropbox is automatically upgrading itself

Dropbox is designed to automatically download and install new versions of itself. This feature does a great job of keeping your software up to date (applying necessary security patches as soon as possible), but it can lead to unexpected behavior when running in a 24×7 environment. What happens if something goes wrong? Suppose there is a “bad build”? And how do we prevent AlwaysUp from launching new copies of Dropbox as it goes up and down while the update is being applied?

This article on Dropbox auto-updates describes a solution. Please review and apply the recommended settings to avoid interruption in the face of automatic updates.

Your Dropbox folder was temporarily inaccessible

Dropbox will stop dead in its tracks if it is unable to access the folder holding shared files. It may throw up a message like this:

Is your Dropbox folder on a network drive? Perhaps there was a problem getting to the network as your machine booted. If that is the case, we recommend setting Dropbox to startup Automatically, but shortly after the computer boots. This will give critical services an extra 1-2 minutes to properly initialize before the software tries to access your network folder.

Dropbox is running into another transient problem

Problems are not limited to network drives. There are a host of other reasons why Dropbox will fail to start properly. These include:

In these situations, Dropbox may be trying to tell you what is wrong. But because it is running in the background as a windows service, you will not see any error popups on your desktop.

When you discover that Dropbox isn’t working, try switching to Session 0 to see if Dropbox is showing an error message:

A helpful error message may indicate how to resolve the problem.

Please be sure to get in touch if none of these tips help your situation!

Posted in AlwaysUp | Tagged , , , | Leave a comment

Q & A: Can AlwaysUp Kill & Restart my Idle Application?

Q & A

I’m using ncrack to monitor our network. I recently started running it as a windows service under AlwaysUp. Everything is working perfectly except that sometimes ncrack stops capturing traffic. The CPU goes to zero and nothing else is written to the log files. Is there some way to get AlwaysUp to terminate ncrack and start a fresh instance?

— Michael

Hi Michael. AlwaysUp doesn’t have an “idle CPU” monitor built in, but you can use a Sanity Check Plugin to solve your problem.

What is a “Sanity Check Plugin” you ask?

The Sanity Check feature allows AlwaysUp to detect arbitrary problems with your application running as a windows service. At its heart is a special plugin (a script or executable) that informs AlwaysUp when decisive action — such as restarting your application or rebooting the machine — is necessary. Dig into the technical details at the Sanity Check page.

Our pre-configured CheckForCPUActivity plugin will empower AlwaysUp to restart ncrack if it sits idle for too long. Here is how to set it up:

  1. First, make sure that you have AlwaysUp version 10.2 or later on your machine. That release (from June 2017) introduced important enhancements to the Sanity Check feature.

    Select Help > About AlwaysUp… to check what version of AlwaysUp you have installed:

  2. Next, download the CheckForCPUActivity utility from our web site. Save it in your AlwaysUp installation folder, usually C:\Program Files (x86)\AlwaysUp\

  3. Edit your application in AlwaysUp.

  4. Switch to the Monitor tab. Check the Whenever it fails a “sanity check” box and click the triple-dots button:

  5. Working with the “Configure Sanity Check” window that comes up:

    1. In the Run field, enter the following command line:

      "C:\Program Files (x86)\AlwaysUp
      \CheckForCPUActivity.exe" $ALWAYSUP_PID 60

      This will check ncrack for any CPU activity over 60 seconds.

    2. Using the Every controls, specify how often AlwaysUp should inspect ncrack. Every 10 minutes should be sufficient but feel free to tune as you like.

    3. Click the OK button.

  6. And finally, click the Save >> button to record your changes.

With these settings in place, AlwaysUp will launch CheckForCPUActivity every 10 minutes. Each run will watch ncrack for 60 seconds and if no CPU activity is detected over that period, AlwaysUp will restart ncrack.

A note to other customers: This approach will work with any application where minimal CPU usage indicates a failure. The solution presented is not specific to ncrack.

Best of luck with your windows service!

Posted in AlwaysUp | Tagged , , , , | Leave a comment

Q & A: Will Service Protector Start Automatically When My Server Reboots?

Q & A

Hello, I’m testing your Service Protector program and I was wondering if it starts automatically when my server reboots? I didn’t notice an option for that. I have my server restart every night, will this be an issue with the trial version?

— James

Hi James. Yes, Service Protector will automatically start to protect your service whenever your server reboots. Restarting your server every night will not pose a problem.

You can’t find an option to automatically restart because there isn’t one! That functionality is built in. And the desktop application you run to setup your windows service will not start because it doesn’t need to. Confused? Let me explain…

You see, Service Protector has a couple of parts:

  1. The desktop application you run to configure your windows services

    When you install Service Protector, a convenient shortcut will be created on your desktop:

    Service Protector Desktop Icon

    Double-clicking that shortcut will launch Service Protector:

    Service Protector Management Program

    But this application is merely a management utility, a “waiter/waitress” in the restaurant.

    You use this management utility to:

    • choose the windows service you wish to keep running 24/7
    • specify the options for monitoring the service
    • view daily and weekly performance reports, and more

    This GUI utility does not monitor your services (or do any cooking, if we keep the restaurant analogy going). Therefore it does not need to start when your computer boots. You run it on demand, whenever you need to interact with Service Protector.

  2. An invisible/background component that babysits each of your windows services

    Whenever you setup a service to be monitored (like the Print Spooler in the screenshot above), a background program is deployed to do the work. That program is completely invisible and the only way to see it is by using the Windows Task Manager (or a relative, like the excellent Process Explorer).

    Look for ServiceProtectorAgent.exe. Here it is watching the Print Spooler on Windows Server 2016:

    ServiceProtectorAgent.exe in Task Manager

    Note that this component is itself a windows service! If your service is named “Spooler”, you will find a new service called “ServiceProtector: Spooler” on your machine:

    Service Protector Spooler Service

    The service’s startup type will be “Automatic”, to ensure that the Agent starts as soon as your machine boots. You never have to start it yourself.

    So to complete the analogy, this background component is the restaurant chef — busy in the kitchen cooking the meals submitted by the waiter/waitress.

Hopefully it makes sense now! Please let us know if not. But the bottom line is that we’ve got you covered. :)

Posted in Service Protector | Tagged , , | Leave a comment

Q & A: How do I force my .NET console application to run 64-bit?

Q & A

We have installed AlwaysUp version (Sep. 2 2016) on Windows Server 2012 R2 Standard. We have multiple jobs that run a 64-bit .NET Console Application as a windows service, but we keep getting a SystemOutMemoryException error. What we found watching the Task Manager is that the EXE always runs as 32-bit. How do we get AlwaysUp to run the console app as 64-bit?

— Clayton

Hi Clayton. There are a couple of ways to force your .NET application to run in 64-bit mode:

  1. Build a 64-Bit .NET Version

    If you use Microsoft’s Visual Studio, the build configuration is likely be set to Any CPU (the default):

    Visual Studio Any CPU Configuration

    This will produce an executable that will run in either 32-bit or 64-bit mode, depending on the version of .NET available.

    To run your executable in 64-bit only, change the configuration to x64 and rebuild.

    If your project doesn’t have a x64 configuration, create one like this:

    1. Select Build > Configuration Manager…

    2. In the Configuration Manager,

    3. click the Active solution platform entry and select <New> from the menu that appears:

      Create a New Visual Studio Configuration

    4. In the New Solution Platform window, choose x64 in the top box. We recommend copying settings from Any CPU and creating new project platforms (the default):

      Create a New Visual Studio Configuration: Select x64

    5. Click the OK button to record your changes. Close the Configuration Manager

    6. You should now have x64 as a build option. Set it and recompile to produce a 64-bit only executable:

      Activate the x64 Configuration in Visual Studio

  2. Use CorFlags to Force .NET 64-Bit

    If your application is built with “Any CPU” but you can’t rebuild it in Visual Studio, Microsoft’s free CorFlags utility will come to the rescue.

    Corflags.exe is distributed with the Windows 10 SDK. Be sure to select the “.NET Development Tools” component when installing.

    We actually found the CorFlags exe file in a couple of places on our hard drive:

    C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\Corflags.exe

    C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\Corflags.exe

    You may find CorFlags in older .NET SDK installations as well — it has been around since the release of .NET 2.0 (2005).

    Once you have located CorFlags:

    1. Make a copy of the executable you want to run in 64-bit. The application we used for testing is called SystemInfoDotNet.exe, so we copied it to SystemInfoDotNet64.exe.

    2. Open a command prompt with admin rights.

    3. CD to the folder containing the copied application.

    4. Run CorFlags on the copied application file. Specify the /32BIT- option to strip away the ability to run in 32-bit mode:

      Run CorFlags /32BIT-

    The copied executable will always run in 64-bit mode.

    For example, our SystemInfoDotNet utility — which displays basic process and system information — normally runs in 32-bit mode:

    SystemInfoDotNet running before CorFlags

    But after running CorFlags on SystemInfoDotNet64, it magically runs in 64-bit mode:

    SystemInfoDotNet running after CorFlags

Best of luck with your .NET application Clayton!

Posted in AlwaysUp | Tagged , , , , , , | Leave a comment

Q & A: How Can I Generate a Crash Dump Before AlwaysUp Restarts my Application?

Q & A

Occasionally the application we’re running as a service stops responding, resulting in AlwaysUp restarting it. We would like to run a script prior to the restart to try to generate a crash-dump file so we can find out where the problem is. Is that possible?

— Kelly @ Sabre

Hi Kelly. Sorry to hear of the trouble! Please follow these steps to automatically generate a crash dump whenever your application terminates:

  1. Download & install Microsoft’s free ProcDump utility

    ProcDump — yet another excellent utility from the Sysinternals team — easily creates a dump file from any running process. It is our tool of choice when exploring application crashes.

    Download the ProcDump .Zip package and extract all files to a convenient location. We have placed the files in “C:\Apps\ProcDump” for this article.

    Be sure to run ProcDump at least once and accept the Sysinternals EULA. We don’t want the utility to hang when we run it unattended as a background service!

  2. Compose the command line to capture a crash dump when your application stops

    ProcDump features an impressive set of command line options. Please review and identify the flags that work best for your situation.

    For example, we use this command to dump the notepad.exe application whenever it stops running:

    c:\Apps\ProcDump\procdump.exe -t notepad

    Please ensure that this command works as expected. Start your application, run the command and then terminate your application. Is a dump file created? Troubleshot and fix if not.

  3. Setup your ProcDump command as a Windows Service in AlwaysUp

    Your application is running 24×7. To configure ProcDump to operate on the same schedule and capture the dump file at any time:

    1. Start AlwaysUp and select Application > Add… to bring up the Add Application window.

    2. On the General tab:

      In the Name field, enter a suitable name for this new service. We have used “ProcDump Notepad”.

      In the Application field, enter the full path to ProcDump.exe.

      In the Arguments field, provide the command line options you developed in step 2. Be sure to add the -w flag, which will cause ProcDump to wait for your app to launch if necessary.

      And in the Start in directory field, enter the folder where you want the dump files to be written. (Leaving this blank will cause dump files to be created in the ProcDump folder.)

      ProcDump Notepad Service Settings - General

    3. On the Logon tab, specify your windows account. ProcDump should run in this account since you know it works there (and that the EULA has been accepted).

      ProcDump Notepad Service Settings - Logon

    4. Click the Save >> button to record the ProcDump service.

    5. And finally, start your new service (from the Application menu).

      Here is what the finished setup looks like for us, with Notepad running as a service and ProcDump monitoring it (also as a service):

      ProcDump Notepad Service Settings - Logon

  4. Test

    Now that everything is in place, you should confirm that a crash dump will be created whenever your application stops.

    Open the Task Manager and kill your application. Does a new dump file appear in the expected location? If not, please review all the steps and ensure that nothing was missed.

Best of luck debugging your program!

Posted in AlwaysUp | Tagged , , , , | Leave a comment

Q & A: How Do I Turn Off Service Protector During Scheduled Maintenance?

Q & A

Wanted to know if there’s a way for Service Protector to not monitor a service during a patching period of time? Or any scheduled period of time without sending a million alerts?

— Mark @ Red Roof Inns

Hi Mark. Apologies for the barrage of unnecessary emails! Unfortunately Service Protector doesn’t know that it is OK for your service to be down while you are patching. It is diligently doing its job.

To avoid the false alarms, we recommend shutting down Service Protector at the start of your maintenance window and reactivating it once patching has concluded. These operations can be performed from the Service Protector GUI or with the standard Windows NET command.

You see, Service Protector creates a Windows Service for each service it monitors. If your service is named “MyService”, then Service Protector creates a service called “ServiceProtector: MyService” to watch your target service. Here is what it looks like for the “Print Spooler” service on our Windows Server 2016 machine:

Note that the service name may not be the same as the friendly “display name” you see in Service Protector (and Services.msc). For example, the service name of the “Print Spooler” service is actually “Spooler”:

This post shows how to find the service name.

How to Stop Protection at the Start of Maintenance

  • Stopping From the GUI

    Select Stop <ServiceName> from the Protector menu. This will shut down Service Protector but will leave your target service running:

    Stop Protecting your Windows Service

  • Stopping From the Command Line

    This command will stop the instance of Service Protector monitoring a service named “MyService”:

    NET STOP “ServiceProtector: MyService”

    Here is what the process looks like for the Spooler service:

    Run NET STOP

    Simply run the NET STOP command before patching starts.

How to Restart Protection at the End of Maintenance

  • Starting From the GUI

    Select Start <ServiceName> from the Protector menu. This will fire up Service Protector — and your target service if it’s idle:

    Start Protecting your Windows Service

  • Starting From the Command Line

    A slightly different version of the NET command will restart the instance of Service Protector monitoring a service named “MyService”:

    NET START “ServiceProtector: MyService”

    Restarting protection for the Spooler service looks like this:


    Run the NET START command once your system is back to normal.

How to Stop and Restart Service Protection Automatically

For patching that occurs at a defined time, we recommend using the Windows Task Scheduler to automate the process. Create a pair of scheduled tasks — one to stop protection and the other to restart it.

For example, if maintenance occurs every Saturdays from 1 AM to 3 AM, your first scheduled task could run NET STOP at 12:59 AM. The second task could be configured to run NET START at 3:01 AM.

Posted in Service Protector | Tagged , , , , , | Leave a comment

AlwaysUp 10.5: Restricted Rights, Smoother Shutdowns, and more

Check out what's new in AlwaysUp

We’re happy to announce a new version of AlwaysUp — our popular application that runs any application 24×7 as a Windows Service. It has been more than 6 months since the last public release so here is what’s new:

Start your application without full admin rights

Windows services are trusted, advanced components. As such, they typically run with full rights. Security mechanisms that limit capabilities — like Microsoft’s User Account Control (UAC) — do not constrain services.

But there are legitimate cases for wanting to run an application in the context of a windows service but without full administrative rights. For example:

  • You don’t entirely trust the application. Even if it comes from a reputable source, are you 100% sure that it won’t modify private files or read sensitive data?
  • Your organization operates a “locked down” environment. Government agencies and large corporations often treat security as the number one priority.
  • Your application requires it. Such is the case with Microsoft’s popular cloud storage solution, OneDrive.

The typical approach for security-conscious folks is to create a new account with limited, non-admin rights and specify that account on the AlwaysUp Logon tab. But that often fails because the entire service is run without admin rights, limiting what AlwaysUp itself can do.

In AlwaysUp 10.5, you can specify an administrator on the Logon tab and check the new Launch the application without admin rights option to ensure that the application operates with limited privileges:

To explore the details behind this new capability, check out our free, standalone Run With Restricted Rights utility. It offers the same functionality, but for folks not using AlwaysUp.

Note: Not every program will function properly without admin rights. Be sure to test thoroughly to confirm that your application is compatible with this new setting.

Smoother shutdowns

Windows shutdown can be chaotic. The operating system must notify each application (and windows service) that it should close — while allowing a waffling operator to interrupt the process.

When AlwaysUp is running an application as a service, confusion can arise when the application receives the shutdown signal before AlwaysUp does. In that situation, AlwaysUp tries to restart the application, leading to unnecessary “thrashing” as the system closes.

AlwaysUp 10.5 does a better job of detecting that a shutdown is in progress — even before it is officially notified by Windows.

Improved support for Windows 10 SHB

The US Department of Defense (DoD) has mandated that “all physically domain-joined computers running a Microsoft Windows based operating system must transition to the Windows 10 SHB (Secure Host Baseline) operating system” — a pre-configured and security hardened version of Windows.

While AlwaysUp is fully compatible with all editions of Windows 10, the stringent security in SHB implementations exposed a couple of bugs in our code. In one situation, AlwaysUp’s main window would become unresponsive and in another, the licensing code would fail. Both of these deficiencies have been fixed and several customers are happily running services on Windows 10 SHB.

Other fixes & improvements

  • AlwaysUp routinely interacts with the Windows Event Logs. When these logs became unusually large (containing hundreds of thousands of entries), AlwaysUp would take a while to process the entries, causing the main window to occasionally hang. This is no longer an issue now that the underlying code has been streamlined and optimized.
  • Many customers rely on a sanity check plugin to detect when an application running as a service has failed. Output from those plugins are now captured and emailed, if so configured.
  • Customers looking to install AlwaysUp silently as a part of their own products had to tolerate an annoying prompt that interrupted the process. That prompt has been removed.

As usual, please review the version history for the full list of features, fixes and improvements included in this release.

Upgrading to AlwaysUp Version 10.5

As per our upgrade policy, customers who purchased AlwaysUp 9 (after September 2014) can upgrade to version 10.5 at no additional cost. Just download and install “over the top” to preserve your existing applications an all settings. Your registration code will continue to work.

If you bought AlwaysUp version 8 or earlier (before September 2014), you will need to upgrade to use version 10.5. Please purchase upgrades here — at a 50% discount.


Posted in AlwaysUp | Tagged , , , | Leave a comment

AlwaysUp not Working? Please Send us these Details so we can Help!

Help us help you

Sorry to hear that you are having a problem running your application with AlwaysUp! Windows services can be tricky beasts but our team of experts has spent many years wrestling them into submission. Rest assured that we will do our best to get you up and running ASAP.

As with most technical problems, the devils are in the details. Please answer these six questions to help us diagnose the problem:

  1. What application are you installing as a Windows Service?

  2. AlwaysUp runs thousands of programs, batch files and scripts, but each one brings its own unique challenges. Which one are you trying to run as a service? Is it publicly available? And what does it do?

    Run Dropbox as a Service   Run Java as a Service   Run Batch File as a Service   Run Box Sync as a Service   Run OneDrive as a Service

  3. What version of AlwaysUp are you running?

  4. Each version of AlwaysUp is different. Knowing which build of the software you have installed enables us to offer you the best advice and the most helpful solutions.

    To find the version number, start AlwaysUp and select About AlwaysUp… from the Help menu. The 4-digit version number is displayed in the window that appears.

    Here you can see that we have installed:

  5. What version of Windows are you running?

  6. The version of Windows installed on your PC can definitely impact your software’s ability to run as a background service. For example, Windows 10 might prevent you from interacting with your application, while older, less secure editions of Windows often behave very differently than their modern counterparts.

    Run the helpful winver command to confirm the operating system you are running. A window like this should pop up to report the details:

    This article from Microsoft support describes a few other ways to find your Windows version.

  7. How have you configured your application in AlwaysUp?

  8. AlwaysUp offers over practical 40 settings to run your program securely as a Windows Service. Some applications run perfectly with only the basic settings applied while others need fine tuning to operate smoothly. We recommend that you send us what you have so far, for review.

    To export your application’s settings to a XML file:

    1. Highlight your application in AlwaysUp

    2. Select Export… from the Application menu (shown here for Google Backup and Sync):

    3. Save the XML file in a friendly location. Attach it to the email you will send with all these details.

    We’ll take a look and let you know if we see anything fishy!

  9. Are any errors reported in the AlwaysUp Activity Logs?

  10. AlwaysUp writes errors and warnings to the Windows Event Logs — the recommended destination for notifications and alerts from Windows Services. While you can use the Windows Event Viewer to browse recent log entries, it is much easier to see that activity from AlwaysUp:

    1. Highlight your application in AlwaysUp

    2. Select Report Activity > Past Week… from the Application menu:

    3. In a few seconds, your web browser will pop up with a page showing when your application/service was started, stopped, etc.:

    4. Please save the web page (Ctrl+S) or take a screenshot of the browser window and send it to us for review.

  11. What is your Windows user/account name?

  12. Does your application work properly when you start it normally on your desktop? If so, then we know that the Windows account you are currently logged in to has the rights and capabilities required to run your application. It is useful to know if this is a different account than what you supplied to AlwaysUp (on the Logon tab).

    To find the name of your Windows account:

    1. Start a command prompt. (Click the Start button and type “command” to find it in the list of programs on your PC.)

    2. Type whoami and hit the enter key. Your windows user name will be printed:

      Please include the full account name in your email to our support team.

Send us these details and we’ll get back to you very soon

Your answers to these questions (along with the XML file from step 4) will give us an excellent understanding of what is going wrong. Please email your specifics to and we will review and respond promptly — usually within a few hours.


Posted in Support | Tagged , , | Leave a comment

Q & A: How Do I get AlwaysUp to Restart my Hung Script?

Q & A

My company uses AlwaysUp CLT to run our script every 5 minutes as a windows service. The script starts running when the PC boots and repeats every 5 minutes throughout the day. It usually takes a few seconds to do its work on each run.

However we have a nagging problem. After some hundred or more cycles, the script occasionally gets stuck and never finishes! When this happens, my customers get upset because their kiosks aren’t updated.

How can I get AlwaysUp to kill the script and restart it whenever it hangs?

— Dan @ LaptopsAnytime

Hi Dan. I’m not sure what your script does, but it is very unlikely that AlwaysUp will be able to tell that the script isn’t working properly. However we can use AlwaysUp’s powerful Sanity Check feature to terminate (and restart) your script when it runs for too long.

To setup the sanity check with the AlwaysUp GUI (we’ll cover the CLT later):

  1. Create a new batch file with a single command: exit 1

    Save the batch file to a convenient location on your file system. We have saved ours to “C:\Scripts\hung-sanity-check.bat”. Note the full path to the new file as we’ll need it in a later step.

  2. Start AlwaysUp. Highlight your application and select Application > Edit… to summon the “Edit/View Application” window.

  3. Switch to the Monitor tab. Check the Whenever it fails a sanity check box and click the button:

  4. In the “Configure Sanity Check” window that comes up:

    1. In the Run section, enter the full path to the batch file you created in the first step.

    2. Using the Every controls, specify a time that you consider “too long” for your script to run. Since your script usually takes a few seconds to run, we recommend entering 2 minutes. That should give an unusually long run some extra time to complete, while ensuring that your customers never experience an outage lasting longer than a couple of minutes.

    3. Also, specify 2 minutes in the Wait for setting and check the Also wait whenever the application is restarted box. These ensure that your script will have time to complete before performing the first sanity check:

  5. Click the OK button and save your settings in AlwaysUp.

With the sanity check monitor in place, your script should never hang for longer than two minutes.

Command line switches for AlwaysUp CLT

To achieve the setup described above with AlwaysUp CLT, specify the following parameters to InstallService:

  • -t “<Full path to your batch file>”

  • -a 120

  • -xd 120

  • -xr

For example, our InstallService command line looked like this:

InstallService.exe “MyMainScript” “c:\Scripts\MyMainScript.bat” -k -m -t “C:\Scripts\hung-sanity-check.bat” -a 120 -xd 2 -xr -rn -f 3 0 -fd 5 1

For a full description of these and other command line flags, please see the “Customized Sanity Checks” section (page 12) in the AlwaysUp CLT User Manual.

Email alerts?

You may also consider setting up email alerts — to inform you when your script had to be forcibly restarted. A timely notification may help you to diagnose and ultimately fix the underlying problem with your temperamental script. Until then, rest assured that AlwaysUp has you covered!

Posted in AlwaysUp | Tagged , , , | Leave a comment