Xshell 脚本
概述
http://www.cxyzjd.com/article/qq_34347375/113464381
脚本示例
vbs
Sub Main
xsh.Screen.WaitForString("请选择资源编号:")
xsh.Screen.Send("i")
xsh.Screen.Send(VbCr)
xsh.Screen.WaitForString("请输入IP地址:")
xsh.Screen.Send("10.213.30.1")
xsh.Screen.Send(VbCr)
xsh.Screen.WaitForString("请选择资源编号:")
xsh.Screen.Send("4")
xsh.Screen.Send(VbCr)
xsh.Screen.WaitForString("需自学习从账号请按回车鍵继续:")
xsh.Screen.Send(VbCr)
xsh.Screen.WaitForString("请输入资源从账号:")
xsh.Screen.Send("root")
xsh.Screen.Send(VbCr)
xsh.Screen.WaitForString("请输入从账号密码:")
xsh.Screen.Send("!SgXmdz!4m")
xsh.Screen.Send(VbCr)
End Sub
注意:若 vbs 无法识别中文,则将文件保存时,选择编码为ANSI。
python
def Main():
xsh.Screen.WaitForString("请选择资源编号:")
xsh.Screen.Send("i\r")
xsh.Screen.Send("\r")
xsh.Screen.WaitForString("请输入IP地址:")
xsh.Screen.Send("10.213.30.1")
xsh.Screen.Send("\r")
xsh.Screen.WaitForString("请选择资源编号:")
xsh.Screen.Send("4")
xsh.Screen.Send("\r")
xsh.Screen.WaitForString("需自学习从账号请按回车鍵继续:")
xsh.Screen.Send("\r")
xsh.Screen.WaitForString("请输入资源从账号:")
xsh.Screen.Send("root")
xsh.Screen.Send("\r")
xsh.Screen.WaitForString("请输入从账号密码:")
xsh.Screen.Send("!SgXmdz!4m")
xsh.Screen.Send("\r")
反馈
此页是否对你有帮助?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.