I am having trouble executing if else statement in vba for secure crt, it seems the statement if
is not being understood by the complier.
I wrote a code so that I could login in using host name "ABCDE" and if I get an error message saying that the host name is incorrect then I will login in using the host ip
crt.Screen.Send "ssh 22008130@ABCDE" & Chr(13)
If
Crt.Screen.WaitForString ("ssh: ABCDE: Temporary failure in name resolution",10) = True
crt.Screen.Send "ssh 22008130@100.127.16.159" & Chr(13)
crt.Screen.WaitForString "Password:"
crt.Screen.Send "Asdf@123" & chr(13)
crt.Screen.Send "exit" & chr(13)
Else If
crt.Screen.WaitForString "Password:"
crt.Screen.Send "Asdf@123" & chr(13)
crt.Screen.WaitForString"ABCDE#"
crt.Screen.Send "exit" & chr(13)
end if
end sub
Microsoft VBScript compilation error
Error: Syntax error
File: C:\Users\22005873\Desktop\Data for script Script for Sfp
DATA\SFPSCRIPT FORERRORINNAME.vbs
Line: 9