0

I have an exe file: "TVRRun.exe" that is located in the directory: "C:\Program Files (x86)\TeleVantage\Client\Reporter".

I'm trying to run that exe file from java code:

public static void runTVRRun() throws IOException {
    String path = System.getenv("programfiles(x86)") + "\\TeleVantage\\Client\\Reporter\\";
    String[] command = {"TVRRun.exe", "-S", templatePath, "-S", tmpReportPath};
    Runtime.getRuntime().exec(command, null, new File(path));
}

but I get the following error:

Exception in thread "main" java.io.IOException: 
Cannot run program "TVRRun.exe" (in directory "C:\Program Files (x86)\TeleVantage\Client\Reporter"): 
CreateProcess error=2, The system cannot find the file specified

I've tried all variations of the exec function, and also ProcessBuilder, but the same error appears.

user3723314
  • 67
  • 1
  • 11

0 Answers0