The Core Technologies Blog

Professional Software for Windows Services / 24×7 Operation


AlwaysUp not Starting your Application? Troubleshoot with the Command Prompt

If you find that your application is starting and then quickly stopping when you run it with AlwaysUp, your application may be trying to report an error message that you simply cannot see. In this situation, we recommend starting your application from a command prompt running as a service, to find out if something useful is being written to the console.

How to start CMD.EXE as a service on your desktop

  1. Highlight your troublesome application in AlwaysUp and select Add Copy… from the Application menu.

    (In this guide, our “StartServer” batch file is failing for some unknown reason so we’ll work with that entry…)

    Add Copy

  2. In the Add Application window that comes up:

    1. In the Application field, enter the full path to the windows command prompt. This is:

      C:\Windows\System32\cmd.exe

    2. If there is anything in the Arguments field brought over from the application you copied, please remove it.

    3. Change the Name field to something meaningful. We have entered “CMD Testing” in this guide.

    4. Set the Start the application field to Manually, from AlwaysUp. We don’t want this command prompt service to start automatically at boot.

    Command Prompt Service - General

  3. If you have specified a user on the Logon tab, switch over there and re-enter the password (a security measure).

    Command Prompt Service - Logon

  4. Those are all the changes we need to make so click the Save >> button to record your new service. It will show up on the AlwaysUp console soon.

    Command Prompt Service Saved

  5. Next, start the new CMD service on your desktop by selecting Application > Start “CMD Testing” in this session:

    Start Command Prompt in Session

    In a few seconds, the familiar black box will pop up on your desktop:

    Command Prompt Service Started


  6. And finally, in the command box, type in the full command line you gave to AlwaysUp — application & arguments. Be sure to specify the exact values that you had supplied to your AlwaysUp service! Please cut & paste to ensure accuracy.

    Hit Enter to run your application and pay special attention to what is written to the command prompt.

  7. Hopefully at this point your application will tell us what is wrong! In our case (pictured below), the batch file can’t find the JAR file it is expecting…

    Command Prompt Showing the Error Message

    Resolving the problem

    Common errors include:

    • Running the wrong executable (doh!)
    • Not properly quoting command-line parameters (smacks forehead)
    • Not running from the correct directory (which you can fix by adding the folder on the General tab)
    • Insufficient permissions to access a required resource (are you using the right user on the Logon tab?)

    The AlwaysUp Frequently Asked Questions (FAQ) will help you resolve these and other common issues. And if you’re still stuck, please feel free to contact us for fresh ideas and expert advice 🙂

    And don’t forget to cleanup when you’re done…

    Once you’ve fixed the problem and verified that your application can start normally with AlwaysUp, please feel free to remove the CMD service by highlighting the entry in AlwaysUp and selecting Application > Remove.

Posted in AlwaysUp | Tagged , | Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *