title: Calling "mysqldump" with Runtime.getRuntime().exec(cmd) from Windows 7
body: <p>I am trying to dump a MySQL database within my Java application the following way:</p>
  
  <pre><code>String[] command = new String[] {"cmd.exe", "/c", "C:/mysql/mysqldump.exe" --quick --lock-tables --user=\"root\" --password=\"mypwd\" mydatabase &gt; \"C:/mydump.sql\""};
  Process process = Runtime.getRuntime().exec(command);
  int exitcode = process.waitFor();
  </code></pre>
  
  <p>The process fails with exit-code 6. I somewhere read that the operand ">" is not correctly interpreted and there was the hint to use "cmd.exe /c" as prefix. But it still doesn't work.</p>
  
  <p>Any ideas?</p>