Hey, I know very little about Java. I do however, know Batch very well. My dilemma is this: I'm working on a server launcher batchfile, and I have the issue of a Java command pausing the script until the whole command is executed and Java says that it's done. For example... Code: set something="> " Java -jar craftbukkit.jar Xmx3G Xms3G -o true op Notch PAUSE Obviously this will not simply tell the server, a Java program, to op player Notch, because it waits on Java being done. So I plan on opening a separate Batch script right before running the server, and then that Batch script will tell the server what needs to be done. Code: tellserver (.bat) Java jar etc... My actual question is this: Is there a Java command (one like -jar, which can be used in a cmd prompt) which will tell a currently running program a certain thing, or will I need to ask a Java programmer to write me a class to do that and call on that class? I'm trying something else, hopefully it will work. Edit: No, it didn't work. Bump Hoping to have an answer soon, as this is effecting the release of my next version EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Uhm correct me if im wrong but isn't this what you need: Piping one batch through another to the server... If yes: http://stackoverflow.com/questions/15994824/faking-standard-input-on-the-windows-command-line and: http://dos.rsvs.net/DOSPAGE/BATCHCOM.HTM (pretty old)
Blocky4Programs I've tried echo TEXT >> C:\cmd.exe and get a permission denied error. Do I need to send it directly to the server somehow? Or, perhaps I can try echo TEXT | java -jar.... I'll look at some of the pages you sent me in more depth.
Yes the commands you want to send to the server need to be send TO the server and not to cmd... Cmd is just the medium you use to send the commands and stuff like that... Why do you want to use batch anyway there are a lot more interesting way to do this... (windows form, shell, java,...)
The code you use at java -jar ect.. Starts up the jar file, that means tht everything done after that will be executed once server is shut... I don't think you can pass a argument thru cmd line in the executed jar...
Indeed I checked a few ideas I had but they didn't work (the piping stuff) You can always try to make a shell or form by yourself it isn't that hard... Or if you want to keep the cmd look you can choose to make a console application... You can do a lot more in those and I would be happy to help you...