<input type="hidden" id="_wpnonce" name="_wpnonce" value="d589524ad4" /><input type="hidden" name="_wp_http_referer" value="/blog/wp-json/wp/v2/posts/5539" /><input type="hidden" id="_wpnonce" name="_wpnonce" value="d589524ad4" /><input type="hidden" name="_wp_http_referer" value="/blog/wp-json/wp/v2/posts/5539" />{"id":5539,"date":"2016-09-09T12:34:31","date_gmt":"2016-09-09T02:34:31","guid":{"rendered":"https:\/\/www.businesslegions.com\/blog\/?p=5539"},"modified":"2016-09-07T11:36:59","modified_gmt":"2016-09-07T01:36:59","slug":"fix-windows-batch-file-not-continue-launching","status":"publish","type":"post","link":"https:\/\/www.businesslegions.com\/blog\/2016\/09\/09\/fix-windows-batch-file-not-continue-launching\/","title":{"rendered":"FIX FOR WINDOWS BATCH FILE THAT DOES NOT CONTINUE LAUNCHING"},"content":{"rendered":"<!--CusAds0--><p>Windows batch files are great for basic automation, especially if you add it to your Windows Startup. However, I just ran into a problem with executing multiple commands in a batch file &#8211; they would not continue and just pause until the program is exited.<\/p>\n<p>Here is an example of the original batch file:<\/p>\n<pre class=\"lang:default decode:true\">@echo off\r\necho ------------------------------------------------\r\necho - Launching Link by Business Legions -\r\necho ------------------------------------------------\r\ntimeout \/t 10 \/nobreak\r\n\"C:\\website.lnk\"\r\nexit<\/pre>\n<p>The batch file simply waits for 10 seconds before opening up a shortcut link which points to a particular website. Chrome is used to open up the website.<\/p>\n<p>The additional requirements was to wait for 5 minutes and then close the website and open another.<\/p>\n<p>So I thought the commands would be this:<\/p>\n<pre class=\"lang:default decode:true\">@echo off\r\necho ------------------------------------------------\r\necho - Launching Link by Business Legions -\r\necho ------------------------------------------------\r\ntimeout \/t 10 \/nobreak\r\n\"C:\\website.lnk\"\r\ntimeout \/t 600 \/nobreak\r\ntaskkill \/f \/im chrome.exe\r\n\"C:\\website2.lnk\"\r\nexit<\/pre>\n<p>The problem with the above batch file was it would just get stuck when the website opens up. If you closed the browser then it would continue. After searching around for the best possible solution I figured out that all I needed to use was the following command:<\/p><!--CusAds0-->\n<p><strong>start &#8220;&#8221;<\/strong> &#8220;C:\\website.lnk&#8221;<\/p>\n<p>It is important to make sure you have &#8220;&#8221; after start because this refers to the TITLE of the window so if you don&#8217;t have this, the link won&#8217;t open.<\/p>\n<p>Finally, the working solution with all the commands used in the batch file is below:<\/p>\n<pre class=\"lang:default decode:true\">@echo off\r\necho ------------------------------------------------\r\necho - Launching Link by Business Legions -\r\necho ------------------------------------------------\r\ntimeout \/t 10 \/nobreak\r\nstart \"\" \"C:\\website.lnk\"\r\ntimeout \/t 600 \/nobreak\r\ntaskkill \/f \/im chrome.exe\r\nstart \"\" \"C:\\website2.lnk\"\r\nexit<\/pre>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5546\" src=\"https:\/\/cdn.businesslegions.com\/blog\/wp-content\/uploads\/2016\/09\/Business-Legions-Batch-File-Issue.png?strip=all\" alt=\"Business Legions Batch File Issue\" width=\"1024\" height=\"475\" srcset=\"https:\/\/cdn.businesslegions.com\/blog\/wp-content\/uploads\/2016\/09\/Business-Legions-Batch-File-Issue.png?strip=all 1106w, https:\/\/cdn.businesslegions.com\/blog\/wp-content\/uploads\/2016\/09\/Business-Legions-Batch-File-Issue-300x139.png?strip=all 300w, https:\/\/cdn.businesslegions.com\/blog\/wp-content\/uploads\/2016\/09\/Business-Legions-Batch-File-Issue-768x356.png?strip=all 768w, https:\/\/cdn.businesslegions.com\/blog\/wp-content\/uploads\/2016\/09\/Business-Legions-Batch-File-Issue-178x83.png?strip=all 178w, https:\/\/cdn.businesslegions.com\/blog\/wp-content\/uploads\/2016\/09\/Business-Legions-Batch-File-Issue.png?strip=all&amp;w=442 442w, https:\/\/cdn.businesslegions.com\/blog\/wp-content\/uploads\/2016\/09\/Business-Legions-Batch-File-Issue.png?strip=all&amp;w=663 663w, https:\/\/cdn.businesslegions.com\/blog\/wp-content\/uploads\/2016\/09\/Business-Legions-Batch-File-Issue.png?strip=all&amp;w=884 884w\" sizes=\"(max-width: 960px) 100vw, 960px\" \/>If you need any help with this leave me a comment and I&#8217;ll try my best to help.<\/p>\n<p>&nbsp;<\/p>\n<div class=\"lt-box\" style=\"border:1px solid #1d6a9e\"><div class=\"lt-box-title\" style=\"background-color:#2485C6;border-top:1px solid #a7cee8;text-shadow:1px 1px 0 #0b283b\">DO YOU LIKE WHAT YOU'VE READ?<\/div><div class=\"lt-box-content\">Join our subscription list and receive our content right in your mailbox. If you like to receive some Great deals our Freebies then subscribe now!\r\n\r\n<p><div class=\"tnp tnp-subscription \">\n<form method=\"post\" action=\"https:\/\/www.businesslegions.com\/blog\/wp-admin\/admin-ajax.php?action=tnp&amp;na=s\">\n<input type=\"hidden\" name=\"nlang\" value=\"\">\n<div class=\"tnp-field tnp-field-firstname\"><label for=\"tnp-1\">Name<\/label>\n<input class=\"tnp-name\" type=\"text\" name=\"nn\" id=\"tnp-1\" value=\"\" placeholder=\"\"><\/div>\n<div class=\"tnp-field tnp-field-email\"><label for=\"tnp-2\">Email<\/label>\n<input class=\"tnp-email\" type=\"email\" name=\"ne\" id=\"tnp-2\" value=\"\" placeholder=\"\" required><\/div>\n<div class=\"tnp-field tnp-field-button\" style=\"text-align: left\"><input class=\"tnp-submit\" type=\"submit\" value=\"Subscribe\" style=\"\">\n<\/div>\n<\/form>\n<\/div>\n<\/p>\r\n\r\n<\/div><\/div><!--CusAds0-->\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Windows batch files are great for basic automation, especially if you add it to your Windows Startup. However, I just ran into a problem with executing multiple commands in a batch file &#8211; they would not continue and just pause until the program is exited. Here is an example of the original batch file: @echo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5547,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[830,3,1691,1895],"tags":[1880,1972,2608,1973,1314,2609,458,94,180],"class_list":["post-5539","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-technology","category-technology","category-tip-and-tricks","category-windows","tag-automation","tag-batch","tag-batch-files","tag-files","tag-launch","tag-links","tag-start","tag-website","tag-windows"],"_links":{"self":[{"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/posts\/5539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/comments?post=5539"}],"version-history":[{"count":4,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/posts\/5539\/revisions"}],"predecessor-version":[{"id":5548,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/posts\/5539\/revisions\/5548"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/media\/5547"}],"wp:attachment":[{"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/media?parent=5539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/categories?post=5539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/tags?post=5539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}