When you say it's not working, do you get an error message?
darkagn
Veteran Poster
1,197 posts since Aug 2007
Reputation Points: 404
Solved Threads: 200
Not sure if this will work, but the command for opening the cmd shell in a batch file is simply cmd. Maybe try changing the line
String command = "cmd.exe";
to simply
String command = "cmd";
and see what happens?
EDIT: Actually, if that doesn't work, try "start" instead of "cmd" as that is the command to open a new CMD shell from a running CMD shell.
darkagn
Veteran Poster
1,197 posts since Aug 2007
Reputation Points: 404
Solved Threads: 200
It might also be worthwhile pointing out that this code will only work on windows operating systems. Really you should probably have this in an if-statement to ensure running this code only in a windows environment. An else statement might allow you to open a different shell in Linux, Mac, other environments?
darkagn
Veteran Poster
1,197 posts since Aug 2007
Reputation Points: 404
Solved Threads: 200
Sorry manisha but I am out of ideas. Maybe someone else can help you?
darkagn
Veteran Poster
1,197 posts since Aug 2007
Reputation Points: 404
Solved Threads: 200