{"id":5056,"date":"2014-03-30T18:28:37","date_gmt":"2014-03-30T18:28:37","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-to-double-click-or-single-click-the-bat-file-using-java-or-java-script-which-is-available-in-the-specified-path-collection-of-common-programming-errors\/"},"modified":"2014-03-30T18:28:37","modified_gmt":"2014-03-30T18:28:37","slug":"how-to-double-click-or-single-click-the-bat-file-using-java-or-java-script-which-is-available-in-the-specified-path-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-to-double-click-or-single-click-the-bat-file-using-java-or-java-script-which-is-available-in-the-specified-path-collection-of-common-programming-errors\/","title":{"rendered":"How to double click or single click the BAT file using Java or java script which is available in the specified path-Collection of common programming errors"},"content":{"rendered":"<p>Scenario was i created a BAT file and stored in C drive. I need to write a code for double click or single click using Java.<\/p>\n<p>This is what I tried in Java but it did not work:<\/p>\n<pre><code>try {\n    String path = \"cmd \/c start C:\\\\KeyManager_Stop.bat\";\n    Runtime rn = Runtime.getRuntime();\n    Process pr = rn.exec(path);\n} catch (Exception e) {\n    e.printStackTrace();\n}\n<\/code><\/pre>\n<p>The batch file contains:<\/p>\n<pre><code>cd c:\\test\\test.cmd stop\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Scenario was i created a BAT file and stored in C drive. I need to write a code for double click or single click using Java. This is what I tried in Java but it did not work: try { String path = &#8220;cmd \/c start C:\\\\KeyManager_Stop.bat&#8221;; Runtime rn = Runtime.getRuntime(); Process pr = rn.exec(path); [&hellip;]<\/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-5056","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5056","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=5056"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5056\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5056"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}