Hey
I would like to do a ".bat' type of command in Java: Something automated. Im trying to run a program that is sort of shell itself so it just need to input certain words/letters into the command line box. Lets see if I can explain it better with a theoretical example:
[start of cmd]
C:\>echo hello
hello
C:\>someshell
[start of someshell: It has a command deleteall that deletes everything. It has a command bye that exits someshell]
> deleteall
Are you sure you want to delete all? [Y/N] Y
Everything has been deleted!
> bye
[end of someshell]
C:\>exit
[end of cmd]
As you can see the things I would have to type in the prompt if in cmd are:
echo hello
someshell
deleteall
Y
bye
exit
The biggest problem is the "Y" I believe, since cmd invokes someshell which at the same time and during invokes deleteall.
How could I do this in Java? Thanks.