SecureCRT循环检查设备状态

  1: #$language = "VBScript"
  2: #$interface = "1.0"
  3: 
  4: ' This automatically generated script may need to be
  5: ' edited in order to work correctly.
  6: 
  7: Sub Main
  8: 
  9:     Dim cmd_show_chassis
 10:     Dim status_up, status_down
 11:     Dim time_minutes
 12: 
 13:     cmd_show_chassis = "show chassis"
 14:     status_up = "up"
 15:     status_down = "down"
 16:     test_data = "01:12"
 17: 
 18:     crt.Screen.Synchronous = True
 19: 
 20:     Do
 21:         crt.Screen.Send cmd_show_chassis & vbCr
 22:         if crt.Screen.WaitForString(status_down, 5) then
 23:             crt.Screen.Send vbCr
 24:             crt.Sleep 10000
 25:         else
 26:             exit do
 27:         end if
 28:     Loop
 29: 
 30:     crt.Dialog.MessageBox _
 31:         "GOOD." & vbcrlf & _
 32:         "All Cards is UP! Pelase Enjoy it Now...."
 33: 
 34:     crt.Screen.Synchronous = False
 35: End Sub
 36: 
原文地址:https://www.cnblogs.com/lanzhi/p/6468820.html