Hello,
In my code I need to run a windows application. Through the Command Prompt I would type:
C:\>"C:\Documents and Settings\Simpatico\My Documents\Woerter Speichern Files\changeBackgroud" "C:\\Documents and Settings\\Simpatico\\My Documents\\Woerter Speichern Files\\testimage.bmp"
In Java I wrote:
ProcessBuilder pb = new ProcessBuilder("C:\\Documents and Settings\\Simpatico\\My Documents\\Woerter Speichern Files\\changeBackground", C:\\Documents and Settings\\Simpatico\\My Documents\\Woerter Speichern Files\\testimage.bmp);
pb.directory(new File("C:\\Documents and Settings\\Simpatico\\My Documents\\Woerter Speichern Files"));
try {
pb.start();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
And I get:
java.io.IOException: Cannot run program "C:\Documents and Settings\Simpatico\My Documents\Woerter Speichern Files\changeBackground": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
The problem is with executing the application, changeBackground in the first place, and not the parameter passing.