{"id":11021,"date":"2022-06-21T22:21:33","date_gmt":"2022-06-22T05:21:33","guid":{"rendered":"https:\/\/www.coretechnologies.com\/blog\/?p=11021"},"modified":"2026-04-13T11:20:40","modified_gmt":"2026-04-13T18:20:40","slug":"fail-to-run-program","status":"publish","type":"post","link":"https:\/\/www.coretechnologies.com\/blog\/alwaysup\/fail-to-run-program\/","title":{"rendered":"Q&#038;A: Why does AlwaysUp Fail to Run my Program?"},"content":{"rendered":"<div align=\"center\"><img loading=\"lazy\" decoding=\"async\" class=\"no-lazy-load\" src=\"\/blog\/images\/qa-service-failed-to-start.webp\" style=\"margin-bottom:20px;\" title=\"TITLE\" alt=\"TITLE\" border=\"0\" width=\"380\" height=\"160\" \/><\/div>\n<div class=\"blog-qa-question-box\">\n<img loading=\"lazy\" decoding=\"async\" class=\"no-lazy-load\" src=\"https:\/\/cdn.coretechnologies.com\/images\/quotes-transparent-21x21.webp\" width=\"21\" height=\"21\">&nbsp;&nbsp;I set up our application with AlwaysUp but it doesn&#8217;t work. When I try to start it, it runs for a few seconds then fails with this error:<\/p>\n<blockquote><p><b>AlwaysUpService was unable to start the application properly, failing at least 5 times in 1 minute. AlwaysUpService will now stop.<\/b><\/p><\/blockquote>\n<p>How do I fix this?<\/p>\n<p align=\"right\">&mdash; Mark<\/p>\n<\/div>\n<p>Hi Mark.<\/p>\n<p>AlwaysUp can fail to run your application for a variety of reasons. Here are the most common.<\/p>\n<hr class=\"blog-section\">\n<div style=\"width:100%;margin-bottom:30px;\">\n<div style=\"margin:0px;float:right;\"><a href=\"#top\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cdn.coretechnologies.com\/images\/top.jpg\" border=\"0\" width=\"50\" height=\"18\" title=\"Go to the top\" alt=\"\"><\/a><\/div>\n<\/div>\n<h2 class=\"blog-caption\">Reason #1: Your application cannot run in the account specified on the Logon tab<\/h2>\n<p>By default, Windows Services run in the <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/services\/localsystem-account\" target=\"_blank\" rel=\"noopener\">LocalSystem account<\/a> &mdash; a special, predefined account created and managed by Windows itself.<\/p>\n<p>LocalSystem is a fine choice for the builtin Windows Services. That&#8217;s because it exists on every computer, doesn&#8217;t require a password, and is powerful enough to perform a wide range of administrative tasks.<\/p>\n<p>Consequently, when you setup your application with AlwaysUp, the default is to run in the LocalSystem account. You can see that position on the Logon tab, where the box to override using LocalSystem is not checked:<\/p>\n<div align=\"center\"><a href=\"\/blog\/images\/alwaysup-logon-tab-default.png\" class=\"zoomPopup\" title=\"AlwaysUp Logon tab\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"image-padding\" src=\"\/blog\/images\/alwaysup-logon-tab-default.png\" title=\"AlwaysUp Logon tab (click to enlarge)\" alt=\"AlwaysUp Logon tab\" border=\"0\" width=\"411\" height=\"592\" \/><\/a><\/div>\n<p>But for many applications, running in the LocalSystem account will not work. This is particularly true for regular, desktop applications that are designed to operate in the account where they were installed.<\/p>\n<p>For example, let&#8217;s review a scenario with <a href=\"https:\/\/www.dropbox.com\/\" target=\"_blank\" rel=\"noopener\">Dropbox<\/a>, the popular cloud storage program.<\/p>\n<p>You&#8217;ve installed Dropbox on your PC. You&#8217;ve also configured it to synchronize your important folders with the cloud. Everything works well and Dropbox copies your files as expected. Happy day!<\/p>\n<p>Later that week, a co-worker logs on to your PC. They open File Explorer, browse to the Dropbox folder and double-click Dropbox.exe (the executable that runs Dropbox). Dropbox starts, but it comes up &#8220;blank&#8221;. The files and folders you have configured are nowhere to be seen!<\/p>\n<p>No, Dropbox isn&#8217;t broken. On the contrary, it&#8217;s working exactly as designed.<\/p>\n<p>You see, when you installed and set up Dropbox, the program saved your configuration in a section of the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Windows_Registry\" target=\"_blank\" rel=\"noopener\">Windows Registry<\/a> that only your account can access. And when your co-worker logged on and started Dropbox, they did not see any of your settings because <b>they don&#8217;t have access to your private area in the registry where Dropbox stored your settings<\/b>.<\/p>\n<p>Well, the same is true of the LocalSystem account. It cannot access your Dropbox private settings either. So if you start Dropbox in the LocalSystem account, Dropbox will come up &#8220;blank&#8221; as well.<\/p>\n<p>In essence, the account where you run your application as a Windows Service can have an enormous impact.<\/p>\n<h3 class=\"blog-caption\">Solution<\/h3>\n<p>The remedy is simple. Run your application in a Windows account where you know it works.<\/p>\n<p>In fact, if your application runs fine on your desktop right now, you should use your current account.<\/p>\n<p>To specify your account in AlwaysUp:<\/p>\n<ol>\n<li>\n<p>Start AlwaysUp<\/p>\n<\/li>\n<li>\n<p>Double-click your application to open the <b>Edit\/View Application<\/b> window<\/p>\n<\/li>\n<li>\n<p>Switch to the <b>Logon<\/b> tab<\/p>\n<\/li>\n<li>\n<p>Check the <b>Instead of running the application&#8230;<\/b> box at the top<\/p>\n<\/li>\n<li>\n<p>Enter your user name and password:<\/p>\n<div align=\"center\"><a href=\"\/blog\/images\/alwaysup-enter-windows-account.png\" class=\"zoomPopup\" title=\"Enter your account details\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"image-padding\" src=\"\/blog\/images\/alwaysup-enter-windows-account.png\" title=\"Enter your account details (click to enlarge)\" alt=\"Enter your account details\" border=\"0\" width=\"411\" height=\"592\" \/><\/a><\/div>\n<p>Don&#8217;t know the user name of your current? Run <a href=\"https:\/\/en.wikipedia.org\/wiki\/Whoami\" target=\"_blank\" rel=\"noopener\">whoami<\/a> at a command prompt to find out.\n<\/li>\n<li>\n<p>Save your settings<\/p>\n<\/li>\n<\/ol>\n<p style=\"margin-top:30px\">\nHopefully your application will behave better now that you&#8217;re running it in the correct account.\n<\/p>\n<p>However, if you&#8217;re still having problems, try starting your application in the current session which will make it visible on your desktop. Select <b>Start in this session<\/b> from the <b>Application<\/b> menu to try:<\/p>\n<div align=\"center\"><a href=\"\/blog\/images\/restart-onedrive-in-this-session.png\" class=\"zoomPopup\" title=\"Restart OneDrive in this session\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"image-padding\" src=\"\/blog\/images\/restart-onedrive-in-this-session.png\" title=\"Restart OneDrive in this session (click to enlarge)\" alt=\"Restart OneDrive in this session\" border=\"0\" width=\"520\" \/><\/a><\/div>\n<p>And now that you can see your application, watch out for warnings and errors that are holding up the action.<\/p>\n<hr class=\"blog-section\">\n<div style=\"width:100%;margin-bottom:30px;\">\n<div style=\"margin:0px;float:right;\"><a href=\"#top\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cdn.coretechnologies.com\/images\/top.jpg\" border=\"0\" width=\"50\" height=\"18\" title=\"Go to the top\" alt=\"\"><\/a><\/div>\n<\/div>\n<h2 class=\"blog-caption\">Reason #2: Your application has a problem unrelated to AlwaysUp<\/h2>\n<p>An application that fails to start with AlwaysUp often fails to start without AlwaysUp as well!<\/p>\n<p>For example, that your application can fail to start because:<\/p>\n<ul>\n<li>\n<p>It was <b>never installed<\/b> and configured properly in your account<\/p>\n<\/li>\n<li>\n<p>A recent update (or a Windows patch) <b>broke the software<\/b><\/p>\n<\/li>\n<li>\n<p>It&#8217;s encountering an <b>error that prevents it from working<\/b><\/p>\n<\/li>\n<\/ul>\n<h3 class=\"blog-caption\">Solution<\/h3>\n<p>Put AlwaysUp aside and launch your application normally on your desktop.<\/p>\n<p><b>Does it start?<\/b> Do you see any errors?<\/p>\n<p>How about in the <b>application&#8217;s logs<\/b>? If your application writes to a log file, be sure to check the file for telltale warnings and errors.<\/p>\n<p>If you find a problem, <b>you must fix it before re-engaging AlwaysUp<\/b>.<\/p>\n<p>As you can imagine, if your application doesn&#8217;t run properly by itself, it won&#8217;t magically work as a Windows Service with AlwaysUp either!<\/p>\n<hr class=\"blog-section\">\n<div style=\"width:100%;margin-bottom:30px;\">\n<div style=\"margin:0px;float:right;\"><a href=\"#top\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cdn.coretechnologies.com\/images\/top.jpg\" border=\"0\" width=\"50\" height=\"18\" title=\"Go to the top\" alt=\"\"><\/a><\/div>\n<\/div>\n<h2 class=\"blog-caption\">Reason #3: Your program starts and completes (too) rapidly<\/h2>\n<p>When you run your application normally on your desktop, how long does it take to complete?<\/p>\n<p>If it only runs for a few seconds, AlwaysUp may be misinterpreting the quick exit as a failure to start at all!<\/p>\n<p>We saw this scenario most recently with a customer <a href=\"\/products\/AlwaysUp\/Apps\/RunPythonScriptAsAService.html\">running a Python script with AlwaysUp<\/a>. The script would check a folder for new files and close within 1 second if no files were found. And when it exited, AlwaysUp would log an error saying that the script failed to start properly and try to restart it again. The end result was to give up after 5 attempts, just as you reported.<\/p>\n<h3 class=\"blog-caption\">Solution<\/h3>\n<p>One quick fix is to ensure that your application takes a bit longer to run. For example, if you&#8217;re running a batch file, you can add a <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows-server\/administration\/windows-commands\/timeout\" target=\"_blank\" rel=\"noopener\">TIMEOUT<\/a> statement right before your script exits.<\/p>\n<p>Similarly, you can delay your C++, C# or VB application by calling <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/synchapi\/nf-synchapi-sleep\" target=\"_blank\" rel=\"noopener\">Sleep<\/a> (or an equivalent) to introduce a delay prior to a speedy exit.<\/p>\n<p>However, if you cannot modify your application, you can modify how AlwaysUp works. By creating an empty file named <b>alwaysup-dont-panic-on-quick-exit.txt<\/b> in your AlwaysUp installation directory (by default, <b>C:\\Program Files (x86)\\AlwaysUp<\/b>), you will signal AlwaysUp not to treat a quick exit as a failure.<\/p>\n<hr class=\"blog-section\">\n<div style=\"width:100%;margin-bottom:30px;\">\n<div style=\"margin:0px;float:right;\"><a href=\"#top\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cdn.coretechnologies.com\/images\/top.jpg\" border=\"0\" width=\"50\" height=\"18\" title=\"Go to the top\" alt=\"\"><\/a><\/div>\n<\/div>\n<p style=\"margin-top: 30px\">\nHopefully one of these solutions addresses your problem. Please be sure to <a href=\"\/support\/\">get in touch<\/a> again if not!<\/p>\n<!-- relpost-thumb-wrapper --><div class=\"relpost-thumb-wrapper\"><!-- filter-class --><div class=\"relpost-thumb-container\"><style>.relpost-block-single-image, .relpost-post-image { margin-bottom: 10px; }<\/style><h3>You may also like...<\/h3><div style=\"clear: both\"><\/div><div style=\"clear: both\"><\/div><!-- relpost-block-container --><div class=\"relpost-block-container relpost-block-column-layout\" style=\"--relposth-columns: 3;--relposth-columns_t: 2; --relposth-columns_m: 2\"><a href=\"https:\/\/www.coretechnologies.com\/blog\/alwaysup\/secure-windows-service\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Q&amp;A: How do I Protect my AlwaysUp Services from Unauthorized Changes?\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/protect-alwaysup-service-150x150-1.webp\" style=\"aspect-ratio:1\/1\" style=\"aspect-ratio:1\/1\"><\/img><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: #333333;\"><h2 class=\"relpost_card_title\">Q&amp;A: How do I Protect my AlwaysUp Services from Unauthorized Changes?<\/h2><\/div><\/div><\/a><a href=\"https:\/\/www.coretechnologies.com\/blog\/alwaysup\/eliminate-console-app-errors\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Q&amp;A: How do I Eliminate Errors from my C# Console App Windows Service?\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/service-error-150x150-1.png\" style=\"aspect-ratio:1\/1\" style=\"aspect-ratio:1\/1\"><\/img><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: #333333;\"><h2 class=\"relpost_card_title\">Q&amp;A: How do I Eliminate Errors from my C# Console App Windows Service?<\/h2><\/div><\/div><\/a><a href=\"https:\/\/www.coretechnologies.com\/blog\/windows-services\/why-windows-service-starts\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Q&amp;A: Why did my Windows Service Start Unexpectedly?\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/why-did-windows-service-start-150x150-1.png\" style=\"aspect-ratio:1\/1\" style=\"aspect-ratio:1\/1\"><\/img><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: #333333;\"><h2 class=\"relpost_card_title\">Q&amp;A: Why did my Windows Service Start Unexpectedly?<\/h2><\/div><\/div><\/a><\/div><!-- close relpost-block-container --><div style=\"clear: both\"><\/div><\/div><!-- close filter class --><\/div><!-- close relpost-thumb-wrapper -->","protected":false},"excerpt":{"rendered":"<p>&nbsp;&nbsp;I set up our application with AlwaysUp but it doesn&#8217;t work. When I try to start it, it runs for a few seconds then fails with this error: AlwaysUpService was unable to start the application properly, failing at least 5 &hellip; <a href=\"https:\/\/www.coretechnologies.com\/blog\/alwaysup\/fail-to-run-program\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":11182,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[26,288,127,161,170],"class_list":["post-11021","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-alwaysup","tag-alwaysup-tag","tag-localsystem-account","tag-qa","tag-product-support","tag-troubleshooter"],"_links":{"self":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/11021","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=11021"}],"version-history":[{"count":20,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/11021\/revisions"}],"predecessor-version":[{"id":13441,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/11021\/revisions\/13441"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media\/11182"}],"wp:attachment":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=11021"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=11021"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=11021"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}