0

I'm working on a peice of software that sends some simple commands to a console based application which my application will start, a bukkit server

This bukkit server is started by the execution of a .bat command, which i'll quote below, which opens a console window from which commands can be entered by the user.

.Bat file

java -Xmx2048M -jar craftbukkit-1.6.4-R2.0.jar -o false
PAUSE

This creates this window:

Click Here for image

~~~~~~~~~~~~~~~~

My question is, if my program was to run this bat file to start the server, will I still be able to send and read lines from the subsiquent console application the same as if I were to run a console .exe directly?

If I can't, are there any workarounds?

Thanks, Alex.

2
Contributors
1
Reply
16
Views
3 Years
Discussion Span
Last Post by tinstaafl
0

will I still be able to send and read lines from the subsiquent console application the same as if I were to run a console .exe directly?

Probably not, at least not without a lot of headaches. But since a .bat is basically a textfile you can read it as one, using the System.IO class, and parse the command to run the console and redirect its standard in,out and error streams using the Process Class. You even have the option to run the process with showing any window.

Edited by tinstaafl

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.