title: JAVA: Runtime.getRuntime().exec() The system cannot find the file specified
body: <p>I have an exe file: "TVRRun.exe" that is located in the directory: "C:\Program Files (x86)\TeleVantage\Client\Reporter".</p>
  
  <p>I'm trying to run that exe file from java code:</p>
  
  <pre><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));
  }
  </code></pre>
  
  <p>but I get the following error:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I've tried all variations of the exec function, and also ProcessBuilder, but the same error appears.</p>