I recently updated my Java version to JDK7u21. In the release notes of update 21, it is clearly mentioned about issue using Runtime.exec.
I therefore want to change my code to use ProcessBuilder. I am trying to execute a command with spaces in it. But even if using ProcessBuilder for this, I land up in C:\Users\Parag.Joshi\Documents and not the exact directory.
Below is my code:
ProcessBuilder p = new ProcessBuilder("cmd", "/c", "explorer ", "C:\Local Disk D\My Tutorial");
p.start();
I had a look at Java execute a command with a space in the pathname but didn't get a clue.