VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   Unknown problem with crt.Screen.Synchronous = True (https://forums.vandyke.com/showthread.php?t=12572)

emailsbecker 01-11-2017 07:53 AM

Unknown problem with crt.Screen.Synchronous = True
 
Hi all,

I have this simple test script (scrubbed user/pass/IP):

Code:

#$Language="VBScript"
#$Interface="1.0"

'Option Explicit
crt.Screen.Synchronous = True

Sub Main

  crt.Screen.Send "telnet x.x.x.x" & vbcrlf : crt.Screen.WaitForString "telnet x.x.x.x" & vbcrlf
  crt.Screen.WaitForString "name:"
  msgbox "Saw Name"
  crt.Sleep 500
  crt.Screen.Send "user" & vbcrlf : crt.Screen.WaitForString "user" & vbcrlf
  crt.Screen.WaitForString "word:"
  msgbox "Saw word"
  crt.Sleep 500
  crt.Screen.Send "pass" & vbcrlf : crt.Screen.WaitForString "pass" & vbcrlf
  crt.Screen.WaitForString "#"
  msgbox "Logged in!"
 
End Sub

A raw log of what happens shows:

Code:

HOST1#telnet x.x.x.x
Trying x.x.x.x ... Open



User Access Verification

Username:
Username: user
Password:
% Login invalid

Username: pass
Password:

This raw log shows a CR and LF after the first "Username: " and first "Password: ", and these are not present in a raw log of me doing this manually. I'm not sure what's causing this, nor how to code for it. Any ideas?

bgagnon 01-11-2017 03:55 PM

Hi emailsbecker,

I think you should be *sending* just vbcr, not vbcrlf. What are the results if you change the script accordingly?

If you get the same results, please post the version of SecureCRT you are using.

emailsbecker 01-12-2017 12:54 PM

That was it. Thanks. I never knew there could be a difference in how the remote device responded to those. Good to know.


All times are GMT -6. The time now is 05:42 AM.