I feel silly having to ask this... but is there some trick to getting the Windows Telnet Client to launch from a signed applet?
I thought this would be a pretty easy thing to accomplish, but it's flatly refusing to work the way I think it should.
Here's the code, it's pretty simple....
//String strCmd = "cmd /c C:\\WINDOWS\\system32\\telnet.exe " + Session.getHostIpAddr();
//String strCmd = "C:\\WINDOWS\\system32\\telnet.exe " + Session.getHostIpAddr();
String strCmd = "notepad.exe";
try {
Runtime RT;
RT = Runtime.getRuntime();
Process P = RT.exec( strCmd );
System.out.println( "Telnet Exit Value = " + P.waitFor() );
} catch ( IOException e ) {
e.printStackTrace();
} catch ( InterruptedException e ) {
e.printStackTrace();
}
Running this with the "notepad.exe" test cmd works fine. But all I can ever get from attempting to launch telnet is an exit value of "-1".
No execeptions, no error msgs, just a "-1". I've tried looking at the input/output streams, but saw absolutely nothing there.
I've looked every place I can think of to try and figure out what that "-1" means, but I can't find any documentation that mentions what that exit code might mean.
Has anyone else had any luck with this? Am I just missing something really obvious (always a possibility....) ?