example1.vbs 631 B

12345678910111213141516171819202122
  1. #$language = "VBScript"
  2. #$interface = "1.0"
  3. Sub main
  4. ' turn on synchronous mode so we don't miss any data
  5. crt.Screen.Synchronous = True
  6. ' Wait for a string that looks like "login: " or "Login: "
  7. crt.Screen.WaitForString "ogin: "
  8. ' Send your username followed by a carriage return
  9. crt.Screen.Send "username" & VbCr
  10. ' Wait for a tring that looks like "password: " or "Password: "
  11. crt.Screen.WaitForString "assword:"
  12. ' Send your password followed by a carriage return
  13. crt.Screen.Send "password" & VbCr
  14. ' turn off synchronous mode to restore normal input processing
  15. crt.Screen.Synchronous = False
  16. End Sub