I want to get windows command prompt instance in my java program so that batch commands like cls, dir etc. can be passed directly from my java program and would want to read its output just like we would normally pass this command manually after opening windows command prompt.
WindowsCmdInstance wcn = new WindowsCmdInstance();
CommandOp cop = new CommandOp();
cop = Cwcn.sendCommand("dir");
String readOutput = cop.readConsoleOutput();
I'm expecting something like the above pattern so that i can pass batch commands from my java program just like we manually would do from windows command prompt. I don't want to run my commands as a bat file by using java's runtime instance.
Please help me. Thanks in advance!!
Hussain