Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-11-2017, 07:53 AM
emailsbecker emailsbecker is offline
Registered User
 
Join Date: Apr 2011
Posts: 74
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?
Reply With Quote
  #2  
Old 01-11-2017, 03:55 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,020
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.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 01-12-2017, 12:54 PM
emailsbecker emailsbecker is offline
Registered User
 
Join Date: Apr 2011
Posts: 74
That was it. Thanks. I never knew there could be a difference in how the remote device responded to those. Good to know.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 08:53 PM.