关于secureCRT的问题,高手请进,谢谢!

来源:百度知道 编辑:UC知道 时间:2024/06/18 11:52:37
用这个软件登陆网络设备,如路由器后,我进行了一些列的操作,比如查看路由器状态什么的,那么我可以把这些显示的结果保存下来吗?
我要做一个脚本,如何制作,我第一次在该软件上查看了路由器的状态信息,也显示出来了,那么我可以把这个保存作为脚本吗?
以上问题我已经解决了,但是现在又有新问题,我制作了一个脚本后(大概5个命令),在设备上执行脚本,就执行了一个命令,其他的设备都没有问题,这个是什么原因?请知道答案的人帮帮忙!谢谢!

# $language = "VBScript"
# $interface = "1.0"

Sub main

Dim fso, fHost,fCMDbsn,fCMDscs, strLineHost,strLineCommand,strLogfile,strArray

Const ForReading = 1
Const Hostip=0
Const NodeType=1
Const ScriptPath=""

Set fso = CreateObject("Scripting.FileSystemObject")
ScriptPath=fso.GetParentFolderName(WScript.ScriptFullName)

LogPath=ScriptPath & "\log\"

Set fso = CreateObject("Scripting.FileSystemObject")
Set fHost = fso.OpenTextFile(ScriptPath& "tz.txt", ForReading, 0)
'
Do While fHost.AtEndOfStream <> True
crt.Screen.Synchronous =0
strLineHost = Trim(fHost.Readline )
strArray=split(strLineHost,vbtab,-1)
strLogfile=LogPath & strArray(hostip)
crt.Session.LogFileName = strLogfile

crt.Screen.WaitForString "$"

crt.Session.Lo