I am trying to figure out how to execute my AutoHotKey script from my Java program. The issue is I am not sure the best way to actually do this because when I do this I get an error...
Runtime runtime = Runtime.getRuntime();
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
try {
String actualPath = "C:\\Users\\me\\Desktop\\Coding\\test.ahk";
String autoHotKeyScript = "C:\\Program Files\\AutoHotkey";
runtime.exec(new String[] {autoHotKey, actualPath});
} catch (IOException e) {
e.printStackTrace();
}
With the error :
Cannot run program "C:\Program Files\AutoHotkey": CreateProcess error=5, Access is denied