Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Launch Windows Telnet from Signed Applet ??

843807Aug 16 2006 — edited Jun 30 2008
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....) ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 28 2008
Added on Aug 16 2006
3 comments
163 views