VBS script to backup Cisco configs

Discussion in 'Cisco' started by thefunnel@aol.com, Dec 1, 2005.

  1. Guest

    Hello,

    I need some assistance on a script I am writing. Its purpose is to
    backup running-config files from Cisco switches via telnet and TFTP.

    I need to address the following problems...

    1. All the DOS windows open at once, I would like them to open in
    order.
    2. All the uploaded file names are identical. Hence the previous ones
    are overwritten
    3. I would like the script to read from a text file of IPs

    Any pointers in the right direction would be appreciated.

    Many thanks.

    @echo off
    echo set sh=WScript.CreateObject("WScript.Shell")>telnet.vbs
    echo WScript.Sleep 500>>telnet.vbs
    echo sh.SendKeys "password">>telnet.vbs
    echo sh.SendKeys "~">>telnet.vbs
    echo sh.SendKeys "en">>telnet.vbs
    echo sh.SendKeys "~">>telnet.vbs
    echo sh.SendKeys "password">>telnet.vbs
    echo sh.SendKeys "~">>telnet.vbs
    echo sh.SendKeys "copy running-config tftp://192.168.0.1">>telnet.vbs
    echo sh.SendKeys "~">>telnet.vbs
    echo sh.SendKeys "~">>telnet.vbs
    echo sh.SendKeys "~">>telnet.vbs
    echo sh.SendKeys "exit">>telnet.vbs
    echo sh.SendKeys "~">>telnet.vbs

    start /realtime telnet.exe 192.168.0.10 (first device)
    cscript.exe //nologo telnet.vbs

    start /realtime telnet.exe 192.168.0.11 (second device)
    cscript.exe //nologo telnet.vbs

    del telnet.vbs
    , Dec 1, 2005
    #1
    1. Advertising

  2. garethb Guest

    Hi

    I don't know how to do this, but there is a great freeware tool which
    achieves the same http://www.kiwisyslog.com/cattools2.htm I works really
    well for me.

    Regards
    --
    Gareth Brown | Consultant | 1E Ltd | www.1e.com

    <> wrote in message
    news:...
    > Hello,
    >
    > I need some assistance on a script I am writing. Its purpose is to
    > backup running-config files from Cisco switches via telnet and TFTP.
    >
    > I need to address the following problems...
    >
    > 1. All the DOS windows open at once, I would like them to open in
    > order.
    > 2. All the uploaded file names are identical. Hence the previous ones
    > are overwritten
    > 3. I would like the script to read from a text file of IPs
    >
    > Any pointers in the right direction would be appreciated.
    >
    > Many thanks.
    >
    > @echo off
    > echo set sh=WScript.CreateObject("WScript.Shell")>telnet.vbs
    > echo WScript.Sleep 500>>telnet.vbs
    > echo sh.SendKeys "password">>telnet.vbs
    > echo sh.SendKeys "~">>telnet.vbs
    > echo sh.SendKeys "en">>telnet.vbs
    > echo sh.SendKeys "~">>telnet.vbs
    > echo sh.SendKeys "password">>telnet.vbs
    > echo sh.SendKeys "~">>telnet.vbs
    > echo sh.SendKeys "copy running-config tftp://192.168.0.1">>telnet.vbs
    > echo sh.SendKeys "~">>telnet.vbs
    > echo sh.SendKeys "~">>telnet.vbs
    > echo sh.SendKeys "~">>telnet.vbs
    > echo sh.SendKeys "exit">>telnet.vbs
    > echo sh.SendKeys "~">>telnet.vbs
    >
    > start /realtime telnet.exe 192.168.0.10 (first device)
    > cscript.exe //nologo telnet.vbs
    >
    > start /realtime telnet.exe 192.168.0.11 (second device)
    > cscript.exe //nologo telnet.vbs
    >
    > del telnet.vbs
    >
    garethb, Dec 11, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dleve50
    Replies:
    0
    Views:
    470
    dleve50
    Apr 29, 2005
  2. Sako
    Replies:
    9
    Views:
    1,361
    Arnold Nipper
    Aug 10, 2006
  3. VBS script to backup Cisco configs

    , Dec 1, 2005, in forum: Computer Support
    Replies:
    3
    Views:
    1,376
    garethb
    Dec 11, 2005
  4. Fei
    Replies:
    5
    Views:
    962
    Ben Myers
    Apr 1, 2007
  5. Fei
    Replies:
    1
    Views:
    674
    thanatoid
    Mar 31, 2007
Loading...

Share This Page