Execute commands in putty prompt through java
-
I need to execute unix commands in the putty prompt via java code. So far : String[] cmdArray = {"putty.exe", "server IP"}; Runtime.exec(cmdArray); has got the prompt open. Need help to interact with this window and execute other commands.
-
I need to execute unix commands in the putty prompt via java code. So far : String[] cmdArray = {"putty.exe", "server IP"}; Runtime.exec(cmdArray); has got the prompt open. Need help to interact with this window and execute other commands.
Try reading the documentation[^]. You should be able to execute a remote file, see
3.8.3.6 -m: read a remote command or script from a file
in the above link.
Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
-
I need to execute unix commands in the putty prompt via java code. So far : String[] cmdArray = {"putty.exe", "server IP"}; Runtime.exec(cmdArray); has got the prompt open. Need help to interact with this window and execute other commands.
ProcessBuilder and Process may help. You can get an output stream for the Process and send input to the command line through that.