SecureCRT使用VBS脚本自动备份网络设备配置,目前支持部分H3C及dptech

这是一个使用SecureCRT和VBS脚本自动备份网络设备配置的方法,支持H3C和dptech设备。脚本会通过TFTP将配置文件导出,并对不同设备进行相应的操作,如等待字符串、发送命令等。
摘要由CSDN通过智能技术生成
 


根据网络上的脚本自行捣鼓了下crt自动备份,欢迎各网络管理员试用及提出优化建议。H3C备份方式主要为cfg通过TFTP导出,dptech为屏幕记录,请自行准备独立TFTP工具。
#$language = "VBScript"
#$interface = "1.0"

Dim tftpip
Dim savedpath
Dim fso,file1,line,str1,params
Dim judgebrand '判断设备类型
dim configfiletype '判断配置文件类型
dim h3cconfig,h3cstartup' tftp备份文件时参数
dim showrun
dim tftppath
showrun = "show running-config"

tftpname()
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec(tftppath) rem 启动自定义TFTP服务器

checkip()
checkpath() 

Sub Main

    Const ForReading = 1, ForWriting = 2, ForAppending = 8
    Set fso = CreateObject("Scripting.FileSystemObject")
 Set file1 = fso.OpenTextFile("D:\Users\administrator\Desktop\test backup vbs\list.txt",Forreading, F

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值