Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting

Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 08-22-2020, 08:19 AM
ananthaa2000 ananthaa2000 is offline
Registered User
Join Date: Aug 2020
Posts: 3
If condition in vbs


I seek your guidance for if condition for below script

Below script for login multiple nodes and execute some commands

When I execute below script in SecureCRT ,when the node asks "(yes/no)? " then it send Yes then next line is password and but it is not sending ..it is waiting for password


Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("C:/vblist.txt")

Do Until f.AtEndOfStream

crt.Screen.Synchronous = True
crt.Screen.Send "ssh -l admin " & f.ReadLine & VbCr
crt.Screen.WaitForString "(yes/no)?"
crt.Screen.send "yes" & VbCr
crt.Screen.WaitForString "password:"
crt.Screen.Send "password" & VbCr
crt.Screen.WaitForString "#"
crt.Screen.Send "sh clock" & VbCr
crt.Screen.WaitForString "#"
crt.Screen.Send "exit" & VbCr
crt.Screen.WaitForString "closed." & VbCr
crt.Screen.Synchronous = False



Reply With Quote

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 07:16 PM.