0

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 = "cmd /c start C:\\KeyManager_Stop.bat";
    Runtime rn = Runtime.getRuntime();
    Process pr = rn.exec(path);
} catch (Exception e) {
    e.printStackTrace();
}

The batch file contains:

cd c:\test\test.cmd stop
Dan Grahn
  • 9,044
  • 4
  • 37
  • 74

0 Answers0