command[0] = "cmd";
command[1] = "/C";
command[2] = "dir";
command[3] = "C:\\SomeDir";
Runtime rt = Runtime.getRuntime();
Process p = rt.exec(command , null , workDir);
It is working fine. Here the executable command is "dir". Here p.waitFor() gives value 0.
But if I give any other command suppose "rename *.doc *.rtf"
Here p.waitFor() gives value 1.
It is not working. and no error is coming.
Actually my require is to run our user definnd command from java program. And that command is working properly from command prompt.