
正文
SecureCRT自动登录Linux并设置时间
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
#$language = "VBScript"
#$interface = "1.0"crt.Screen.Synchronous = True' This automatically generated script may need to be
' edited in order to work correctly.Sub Main
crt.Screen.WaitForString "Username: "
crt.Screen.Send "root" & chr(13)
crt.Screen.WaitForString "Password: "
crt.Screen.Send "123456789" & chr(13)
crt.Screen.WaitForString "root> " crt.Screen.Send "status" & chr(13)
crt.Screen.WaitForString "root> " CurrentYear = mid(Now, 9, 2)
CurrentMonth = mid(Now, 1, 2)
CurrentDay = mid(Now, 4, 2)
CurrentHour = mid(Now, 12, 2)
CurrentMinute = mid(Now, 15, 2)
CurrentSecond = mid(Now, 18, 2)
crt.Screen.Send "date " & CurrentMonth & CurrentDay & CurrentHour & CurrentMinute & CurrentYear & vbcr
crt.Screen.WaitForString "root> " crt.Screen.Send "cli" & chr(13)
crt.Screen.WaitForString "redhat> "
crt.Screen.Send "en" & chr(13)
End Sub








