2024年3月26日发(作者:)

SecureCRT是一款仿真终端工具,常用来telnet到路由器或交换机上,它还支持

VBscript和Jscript脚本。下边讲述一种在WINDOWS下利用SecureCRT的脚本功能自

动定时执行一些登录到路由器或交换机来执行的任务:

1.写好要SecureCRT执行的脚本,可登录执行任何操作。如,保存在

d:se800下。内容附在最后。

2.写好启动SecureCRT执行脚本的批处理文件。如add_,保存在d:se800

内容如下:

d:

cd se800

"C:Program " /T /SCRIPT

3.在WINDOWS的控制面板的任务计划里增加任务,如在23:30执行add_,

大功告成。

====================

的内容:

====================

# $language = "VBScript"

# $interface = "1.0"

Function my_Date()

dim y,m,d,h,mm

Dim nowDate,mytime

nowDate=Now()

mytime=time()

y=Year(nowDate)

m=Month(nowDate)

d=Day(nowDate)

h=hour(mytime)

mm=minute(mytime)

my_Date=y & "-" & m & "-" & d

End Function

Sub main

Dim fso,

strLineHost,strLineCommand,strLogfile,strArray

Const ForReading = 1

Const Hostip=0

Const user=1

Const password=2

Const superpwd=3

Const hostname=0

Const NodeType=4

Const my_user="jhxsy"

Const my_pass="2381654"

fHost,fCMDbsn,fCMDscs,