{"id":5317,"date":"2014-03-30T20:39:39","date_gmt":"2014-03-30T20:39:39","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-can-i-execute-a-windows-batch-file-as-a-separate-process-from-java-collection-of-common-programming-errors\/"},"modified":"2014-03-30T20:39:39","modified_gmt":"2014-03-30T20:39:39","slug":"how-can-i-execute-a-windows-batch-file-as-a-separate-process-from-java-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-can-i-execute-a-windows-batch-file-as-a-separate-process-from-java-collection-of-common-programming-errors\/","title":{"rendered":"How can I execute a Windows batch file as a separate process from Java?-Collection of common programming errors"},"content":{"rendered":"<p>See this article for how to use Runtime.exec properly.<\/p>\n<p>You probably need to start a new command line window:<\/p>\n<pre><code>Runtime rt = Runtime.getRuntime();\nString[] commandArgs = new String[]{\"cmd\", \"\/C\", \"start\", \"c:\\\\test.bat\" };\nProcess proc = rt.exec(commandArgs);\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>See this article for how to use Runtime.exec properly. You probably need to start a new command line window: Runtime rt = Runtime.getRuntime(); String[] commandArgs = new String[]{&#8220;cmd&#8221;, &#8220;\/C&#8221;, &#8220;start&#8221;, &#8220;c:\\\\test.bat&#8221; }; Process proc = rt.exec(commandArgs);<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5317","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5317","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5317"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5317\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}