Hi All, I am going nuts here! I am trying to run a batch file (for simplicity lets call us hello.bat, which echos the parameter I pass). I am using Runtime.exec and it works fine with the paramater is no space but it fails when I pass a parameter with a space, here is my code:
cmd[0] = "cmd.exe";
cmd[1] = "/C" ;
cmd[2]="\"C:\\Documents and Settings\\user\\Desktop\\itsutils\\build\\hello.bat\"";
cmd[3] = "\"Hello there\"";
Runtime rt = Runtime.getRuntime()
Process proc = rt.exec(cmd);
//Input stream handler code here...omitted for clarity.
The string parameters to exec are:
cmd.exe /C "C:\Documents and Settings\user\Desktop\itsutils\build\hello.bat" "Hello There"
I get the following output: ERROR>'C:\Documents' is not recognized as an internal or external command,
ERROR>operable program or batch file.
Process exitValue: 1
Can anyone help me out here...is there something fundamental I am missing?