根据网络上的脚本自行捣鼓了下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