{"id":12907,"date":"2026-06-22T08:01:53","date_gmt":"2026-06-22T15:01:53","guid":{"rendered":"https:\/\/www.coretechnologies.com\/blog\/?p=12907"},"modified":"2026-06-22T08:01:53","modified_gmt":"2026-06-22T15:01:53","slug":"stop-command-feature","status":"publish","type":"post","link":"https:\/\/www.coretechnologies.com\/blog\/alwaysup\/stop-command-feature\/","title":{"rendered":"AlwaysUp Feature Spotlight: Stop Your Application With A Special Command"},"content":{"rendered":"<div align=\"center\"><img loading=\"lazy\" decoding=\"async\" class=\"no-lazy-load\" src=\"\/blog\/images\/stop-application-with-command-256x256.webp\" style=\"margin-bottom:20px;\" title=\"AlwaysUp Feature Spotlight: Stop Your App With A Special Command\" alt=\"AlwaysUp Feature Spotlight: Stop Your App With A Special Command\" border=\"0\" width=\"256\" height=\"256\"><\/div>\n<div id=\"blog-toc-container\" style=\"margin-top:20px;margin-bottom:40px;\">\n<ul>\n<li><a href=\"#overview\">What&#8217;s a &#8220;stop command&#8221;? Why would I use it?<\/a><\/li>\n<li><a href=\"#how-to-use\">How do I make AlwaysUp close my application with a special stop command?<\/a><\/li>\n<li><a href=\"#tips\">What are your best tips when using a stop command?<\/a><\/li>\n<\/ul>\n<\/div>\n<p><a id=\"overview\"><\/a><\/p>\n<h2 class=\"blog-caption\">What&#8217;s a &#8220;stop command&#8221;? Why would I use it?<\/h2>\n<p>Stopping your application in AlwaysUp triggers a multi-step shutdown process. The goal of that process is to close your application gracefully, without data loss.<\/p>\n<p>Behind the scenes, AlwaysUp sends multiple <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/winmsg\/wm-close\" target=\"_blank\">standard Windows messages<\/a> to tell your program to wrap up whatever it&#8217;s doing and exit. Fortunately, most programs receive those requests, save their work, and quit without any drama.<\/p>\n<p>But some applications would rather take a different approach. Instead of dealing with standard Windows methods, they <b>provide a command-line to invoke a graceful shut down<\/b>.<\/p>\n<p>For example:<\/p>\n<ol style=\"margin-bottom:24px\">\n<li>\n<p><a href=\"\/products\/AlwaysUp\/Apps\/RunVirtualBoxAsAService.html\">VirtualBox<\/a> allows you to power off or suspend a virtual machine by running the <a href=\"https:\/\/docs.oracle.com\/en\/virtualization\/virtualbox\/6.0\/user\/vboxmanage-controlvm.html\" target=\"_blank\">&#8220;VBoxManage.exe controlvm&#8221;<\/a> command.<\/p>\n<\/li>\n<li>\n<p>The <a href=\"\/products\/AlwaysUp\/Apps\/RunNginxAsAService.html\">nginx web server<\/a> implements a fast shutdown when you run <a href=\"https:\/\/nginx.org\/en\/docs\/beginners_guide.html#control\" target=\"_blank\">&#8220;nginx.exe -s stop&#8221;<\/a>.<\/p>\n<\/li>\n<\/ol>\n<p>In fact, <b>running a &#8220;stop command&#8221; is often the best way to close an application<\/b>. That&#8217;s because the command often provides additional context and gives the program complete control over how to exit.<\/p>\n<p>Furthermore, we can safely assume that the software implements the stop command for a good reason &mdash; and that it should be used when possible.<\/p>\n<p><a id=\"how-to-use\"><\/a><\/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\">How do I make AlwaysUp close my application with a special stop command?<\/h2>\n<ol style=\"margin-bottom:24px\">\n<li>\n<p>Before we get to AlwaysUp, compose the command line that you will use to stop your application:<\/p>\n<ul>\n<li>Start with the full path to the executable to run. Enclose it in quotes if it contains a space.<\/li>\n<li>Follow the executable with all the required parameters for the stop command. Again, be sure to quote parameters with spaces.<\/li>\n<\/ul>\n<p>For example, if the <a href=\"https:\/\/docs.oracle.com\/en\/virtualization\/virtualbox\/6.0\/user\/vboxmanage-controlvm.html\" target=\"_blank\">VirtualBox instructions<\/a> say to run &#8220;VBoxManage controlvm savestate&#8221;, your full command will look like ours:<\/p>\n<blockquote><p>&quot;C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe&quot; controlvm  &#8220;Server 2025 Trial&#8221; savestate<\/p><\/blockquote>\n<p>Or to <a href=\"https:\/\/nginx.org\/en\/docs\/beginners_guide.html#control\" target=\"_blank\">stop nginx<\/a>, this command does the trick for us:<\/p>\n<blockquote><p>&quot;C:\\nginx\\nginx.exe&quot; -p &quot;C:\\nginx\\htdocs&quot; -s stop<\/p><\/blockquote>\n<\/li>\n<li>\n<p>Next, confirm that your command actually does the job. Open a command prompt and ensure that running the command closes your application, as expected.<\/p>\n<p>For instance, we were able to close our VirtualBox machine from the command line just fine:<\/p>\n<div align=\"center\"><a href=\"\/blog\/images\/virtualbox-stop-command-works.png\" class=\"zoomPopup\" title=\"Test your stop command\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"image-padding\" src=\"\/blog\/images\/virtualbox-stop-command-works.png\" title=\"Test your stop command (click to enlarge)\" alt=\"Test your stop command\" border=\"0\" width=\"500\"><\/a><\/div>\n<\/li>\n<li>\n<p>Edit your application in AlwaysUp.<\/p>\n<\/li>\n<li>\n<p>Move to the <b>Extras<\/b> tab.<\/p>\n<\/li>\n<li>\n<p>Check the <b>Use this special command to stop the application<\/b> box and provide the full command you created in step 1.<\/p>\n<p>We entered our VirtualBox command:<\/p>\n<div align=\"center\"><a href=\"\/blog\/images\/set-virtualbox-stop-command.png\" class=\"zoomPopup\" title=\"Set the command line that stops your application\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"image-padding\" src=\"\/blog\/images\/set-virtualbox-stop-command.png\" title=\"Set the command line that stops your application (click to enlarge)\" alt=\"Set the command line that stops your application\" border=\"0\"><\/a><\/div>\n<\/li>\n<li>\n<p>Save your changes.<\/p>\n<\/li>\n<\/ol>\n<p>And with that change in place, AlwaysUp will invoke the command whenever it needs to stop your application.<\/p>\n<p><a id=\"tips\"><\/a><\/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\">What are your best tips when using a stop command?<\/h2>\n<h3>Tip #1: Put your stop command in a batch file<\/h3>\n<p>Is your stop command complex? Or does it involve multiple operations? For example, do you need to set environment variables before running a program?<\/p>\n<p>If so, you should:<\/p>\n<ul>\n<li>create a batch file that stops your application, and<\/li>\n<li>provide that batch file to AlwaysUp on the <b>Extras<\/b> tab.<\/li>\n<\/ul>\n<p>That will be easier (and less error-prone) than trying to cram a complex command line into AlwaysUp.<\/p>\n<h3>Tip #2: Give your program enough time to exit<\/h3>\n<p>By default, AlwaysUp will wait for up to 30 seconds for your stop command to do its work. If the application is still alive after that period, AlwaysUp will fall back to its regular methods and your program may be forcibly terminated.<\/p>\n<p>If your application needs more time to exit, you should set a suitable extension on the <b>Extras<\/b> tab:<\/p>\n<div align=\"center\"><a href=\"\/blog\/images\/set-virtualbox-vm-shutdown-time.png\" class=\"zoomPopup\" title=\"Give your application more time to exit\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"image-padding\" src=\"\/blog\/images\/set-virtualbox-vm-shutdown-time.png\" title=\"Give your application more time to exit (click to enlarge)\" alt=\"Give your application more time to exit\" border=\"0\"><\/a><\/div>\n<h3>Tip #3: Test your stop command from AlwaysUp<\/h3>\n<p>After installing the stop command, be sure to test that it works from AlwaysUp too.<\/p>\n<p>Try stopping your application from AlwaysUp and make sure that your application concludes in a timely fashion, without errors.<\/p>\n<p>Check:<\/p>\n<ul>\n<li>your application&#8217;s log files, to confirm that it shut down properly;<\/li>\n<li>the AlwaysUp activity report (select <b>Application &gt; Report Activity &gt; Today<\/b> to open it in your browser).<\/li>\n<\/ul>\n<div style=\"margin-top:30px\" align=\"center\">\n<div class=\"cta-button-1\">\n<table role=\"presentation\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"left\">\n<tbody>\n<tr>\n<td align=\"center\"><a href=\"\/blog\/tag\/alwaysup-feature-spotlight\/\" title=\"More AlwaysUp features\"><span class=\"nobr\">More AlwaysUp features&#8230;<\/span><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\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\/disable-mt4-auto-updates\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"How to Disable Automatic Updates when Running MT4 as a Windows Service\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/metatrader4-150x150-150x110.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\">How to Disable Automatic Updates when Running MT4 as a Windows Service<\/h2><\/div><\/div><\/a><a href=\"https:\/\/www.coretechnologies.com\/blog\/miscellaneous\/alwaysup-service-protector-activebooks-in-the-windows-store\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"AlwaysUp, Service Protector, ActiveBooks Listed in the Windows Store\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/windows-store-150x150.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\">AlwaysUp, Service Protector, ActiveBooks Listed in the Windows Store<\/h2><\/div><\/div><\/a><a href=\"https:\/\/www.coretechnologies.com\/blog\/software\/google-drive-discontinued\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Goodbye Google Drive, Hello Backup and Sync!\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/backup-and-sync-150x150.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\">Goodbye Google Drive, Hello Backup and Sync!<\/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>What&#8217;s a &#8220;stop command&#8221;? Why would I use it? How do I make AlwaysUp close my application with a special stop command? What are your best tips when using a stop command? What&#8217;s a &#8220;stop command&#8221;? Why would I use &hellip; <a href=\"https:\/\/www.coretechnologies.com\/blog\/alwaysup\/stop-command-feature\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":13512,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[26,345,80,404],"class_list":["post-12907","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-alwaysup","tag-alwaysup-tag","tag-alwaysup-feature-spotlight","tag-feature-spotlight","tag-stop-command"],"_links":{"self":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/12907","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=12907"}],"version-history":[{"count":19,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/12907\/revisions"}],"predecessor-version":[{"id":13586,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/12907\/revisions\/13586"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media\/13512"}],"wp:attachment":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=12907"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=12907"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=12907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}