View Single Post
  #1  
Old 07-30-2021, 10:58 AM
BjoernH BjoernH is offline
Registered User
 
Join Date: Mar 2018
Posts: 55
crt.Screen.ReadString does not behave as expected

Good day.


I'm trying to initialize a variable by capturing the hostname from a server:

Code:
Sub Main
    crt.Screen.Send "uname -n" & vbCr
    crt.Screen.WaitForString vbCr

    strResult = crt.Screen.ReadString(":~#")

    MsgBox strResult

End Sub
The SecureCRT session reads:
Code:
CPU2:ibcx1105vm002ssc001:~# uname -n
ibcx1105vm002ssc001
CPU2:ibcx1105vm002ssc001:~#
The strResult in the MsgBox shows this:
Code:
ibcx1105vm002ssc001
□]□[0mCPU2:ibcx1105vm002ssc001
instead of only the hostname (ibcx1105vm002ssc001).




Please advise.


Bjoern
Reply With Quote