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
服务项目 技术咨询 微信图书 微信视频 微信代码 定制开发 其他福利
服务入口 QQ群有问必答
查看详情
一本书解决90%问题
查看详情
微信开发视频
小程序开发视频
免费代码
¥1888阿里云代金券
查看详情
营销工具
微信特异功能
原文地址:https://www.cnblogs.com/txw1958/p/2210080.html