Controlling cmd from java...HELP!!
Hi, ive been trying so many things to enter several commands from my java program but i havent been succesful. I hope someone can help...
This is what i want to do from java which i can do it manually from cmd.
Ive read this link http://www.javaworld.com/cgi-bin/mai...229-traps.html however, ive been messing around with some of the code but still have had no succes...
This is basically what i want to do (several times)
1. open cmd
2. cd \123\ABC\edf\456
3. (run this command) dsm.cmd –f CREATE –b DSKfromjava –V bb9server.bbdn.local
***dsm.cmd takes this parameters: –f CREATE –b DSKfromjava –V bb9server.bbdn.local
now i can get in java to step 2 with no problem in jave using something like this..
Code:
Runtime runTime = Runtime.getRuntime();
Process pr = runTime.exec("CMD.EXE /c START CMD.EXE /k cd /Bb9-Sicom/blackboard/apps/snapshot/bin");