Hi guys,
My code below works well when it's assumed that PuTTY is resident on the Windows machine where this application is running, and have PuTTY connect to a Linux server on the local network.
//more code
Runtime r = Runtime.getRuntime();
Process p = null;
String s = "C:\\Program Files\\PuTTY\\putty.exe -ssh -l jimmy -pw jim123 192.168.0.51";
try
{
p = r.exec(s);
p.waitFor();
} catch (Exception e)
{
System.out.println("Exception error :"+e.getMessage());
e.printStackTrace();
}
//more code
My question is, how can I specify the IP for the actual location of putty.exe instead of having it assumed as localhost?
Am guessing something along the lines of:
//more code
String s = "\\192.168.0.77\\C:\\Program Files\\PuTTY\\putty.exe -ssh -l jimmy -pw jim123 192.168.0.15";//which doesn't work but gives you a picture of what I'm trying to achieve
try
{
p = r.exec(s);
p.waitFor();
}
//more code
Any useful guide will be much appreciated.
Thank you all.