1. Elaine Tse
  2. PowerBuilder
  3. Thursday, 1 February 2018 14:28 PM UTC

Hello,

I am having difficulty in opening a telnet session from PowerBuilder 12.6 and 2017. The following code returns -1.

   ret = run('telnet '+ipaddress)

The 'telnet ' command works on Windows 7's Run window. 

Any help is greatly appreciated.

Best Regards,

Elaine

Brad Mettee Accepted Answer Pending Moderation
  1. Friday, 2 February 2018 15:56 PM UTC
  2. PowerBuilder
  3. # 1

Telnet.exe on Windows 7 is a 64bit app. You can't open a 64bit app from a 32bit app, although it will work the other way (open 32 from 64). When in the 32bit windows environment, it can't see the 64bit windows apps in c:\windows\system32 because windows remaps that to be the same as c:\windows\syswow64.

I copied telnet.exe to an alternate location and tried running it from a 32bit cmd prompt, and although it opens, it doesn't function properly (no text displays, can't type commands). A bit of digging led me to this - make a subdirectory under the alternate location called EN-US, place a copy of c:\windows\system32\en-us\telnet.exe.mui (from a 64bit cmd prompt) in there. Telnet can now run from the alternate location even when run from a 32bit app.

Hope this helps,

Brad

Comment
  1. Elaine Tse
  2. Thursday, 22 February 2018 20:12 PM UTC
Hi Brad,



Thank you so much for your research and suggestions. I may not implementing your recommendations correctly since I could not get telnet to work on my PC.



I opened a 64-bit cmd prompt as an Administrator, copied the C:\Windows\System32\en-US\telnet.exe.mui to C:\Windows\en-US. I then opened the 32-bit cmd prompt (C:\Windows\SysWOW64\cmd.exe) and typed in the command: telnet, and got the error "'telnet' is not recognized as an internal or external command, operable program or batch file.". I created a subdirectory C:\Windows\en-US\telnet32 and copied the file there, still did not work.



Best Regards,



Elaine

  1. Helpful
There are no comments made yet.
Bradley Schultz Accepted Answer Pending Moderation
  1. Thursday, 1 February 2018 15:28 PM UTC
  2. PowerBuilder
  3. # 2

Trying using the full path to the telnet.exe.


ret = run('c:\windows\system32\telnet.exe ' + ipaddress)

Comment
  1. Elaine Tse
  2. Friday, 2 February 2018 14:53 PM UTC
Thanks for your response. 



Using the full path 'C:\windows\systems32\telnet.exe' does not work either.

  1. Helpful
  1. Brad Mettee
  2. Friday, 2 February 2018 15:55 PM UTC
comment moved to be reply - see other post

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.