Hi,
i have opened up using
Code :String[] commands = {"cmd", "/c", fileLocation}; Runtime.getRuntime().exec(commands);
and now i need to write a couple of lines to the application. Please help!
Thanks in advance!
Printable View
Hi,
i have opened up using
Code :String[] commands = {"cmd", "/c", fileLocation}; Runtime.getRuntime().exec(commands);
and now i need to write a couple of lines to the application. Please help!
Thanks in advance!
Can you describe what you want your application to do?
Are you trying to send data for "cmd" to read? See the choices for the I/O streams for the Process class. The names are sort of backwards. Input is what is input to the process, not input for you.
If you do a search you'll find code samples.
yess thats what im tryind to do! open up a cmd window the write some texts to it to before a task.
i tried searching google but i still dont really know what im looking for, it just comes up with running java files in command prompt.
Search on this forum for the classes involved in the problem. You have one and I mentioned one.
right i figure it out i was doing it right all along! :P
Code :String[] commands = {"cmd", "any cmd command here", "you can do a series of commands", "eg cd C:/Users/Ollie/Documents"}; Runtime.getRuntime().exec(commands);
it's quite simple really!! :P