#1
|
|||
|
|||
If condition in vbs
Hi
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 Loop f.Close ************************************************************* |
#2
|
|||
|
|||
Hi ananthaa2000,
What is the password prompt? Is it a lower case 'p'? If not, you are not going to match it. That's why, you will find, where we include such things in SecureCRT's GUI (such as in Logon Actions), we "expect" all but the first character to allow for either Password/password to be the prompt. If you "wait for" 'assword:', what are the results?
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
yes this is lower char p
|
#4
|
|||
|
|||
Hi ananthaa2000,
Are you always faced with the inquiry that requires the yes/no response? If not, then you must put that in an If statement. Please post a screenshot (see info here about posting graphics in the forums) showing the interaction in the terminal window and where the script gets "hung".
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#5
|
|||
|
|||
Not always ..sometimes..OK i will try to use If in that.Thanks
Moreover can you guide me how to make this script in Automation ? |
#6
|
|||
|
|||
Hi ananthaa2000,
Have you ever considered using dependent session functionality in place of the "old method" of running ssh host from the terminal window? Changes in SecureCRT 7.1 (Beta 1) -- February 26, 2013 ------------------------------------------------------ New features:
However, if you have configured your SSH session to the jumphost so that all the initial authentication is taken care of, then you should be able to make this script the logon script in the Connection / Logon Actions category of Session Options.
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | Rate This Thread |
|
|