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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.