in
IEOC CCIE Forums

IEOC - INE's Online Community

Welcome to INE's Online Community - IEOC - a place for CCIE and CCENT candidates to connect, share, and learn. Our Online Community features CCIE forums and discussions for all tracks including Routing & Switching, Voice, Security, Service Provider, Wireless,, and Storage. Through these online communities you can discuss your questions with thousands of your peers, hundreds of CCIE's and INE's own team of world renowned CCIE instructors and authors, Brian Dennis - Quintuple CCIE #2210, Brian McGahan – Triple CCIE #8593, Petr Lapukhov - Quad CCIE #16379, and Mark Snow - Dual CCIE #14073.
Latest post 07-11-2012 7:39 AM by JoeM. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 05-04-2012 3:12 PM

    • JoeM
    • Top 25 Contributor
    • Joined on 04-15-2012
    • Guadalajara, Mexico
    • Elite
    • Points 18,760

    Idea [I] Putty/KITTY logon bat script

    Over the years, I have used SecureCRT, but the companies always paid for it.  Recently, I was thinking about purchasing it for my personal use, but WOW – sticker shock ($$price$$).

    So, I have continued using PUTTY. In the past, I have made some basic BAT files (lab use only), and lately have been trying PuttyCM and MTputty (I like a lot) for tabbed windows.

    Last week, I was inspired by Sgobo's thread (Lab Login Script - linux) and Daniel's Blog for a Putty logon script – windows.

     

    I finally found the solution for my own labs (mulitple devices).  KITTY is a fork (variant) of Putty for Windows and it extends some features to the command-line.

    So, last weekend I worked on a script....and it is awesome for my use.  If I have only 15-30 minutes......presto.....I am logged on automatically, and my windows are laid out for me.    It is so nice to be able to quickly test out something that I need to prove/proof.  Logon to the lab .......  test/experiment/practice  ...... and cleanup/log off . Done.

     

    BELOW is the absolute bare bones of my  BAT script (1 of a 2-section-lab):

    ====script below=========================

    @echo off

    cd C:\PUT-DIRECTORY-PATH\kitty\

    @REM     Remember that Kitty is putty (extended). Just Change the name to putty.exe, for puttyCM or other putty programs.

     

    @REM    if there is NOT a common password for all devices, remove the following two lines

    echo FOR AUTO-LOGIN--please type or paste your LAB PASSWORD:

    set /p passvar=

     

    start "1" kitty.exe -load "PUT PUTTY DEVICE 1 NAME HERE" -pass %passvar%  -xpos  25  -ypos  0
    timeout /T 2 > nul


    start "2" kitty.exe -load "PUT PUTTY DEVICE 2 NAME HERE"  -pass %passvar%  -xpos  0  -ypos  150
    timeout /T 2 > nul

    start "3" kitty.exe -load "PUT PUTTY DEVICE 3 NAME HERE"  -pass %passvar%   -xpos  25  -ypos  315
    timeout /T 2 > nul

    PAUSE

    @REM    NOTES below

    @REM    username is already in putty settings for the device

    @REM    NO adjustments to Windows Environment necessary

    @REM   JUST REPEAT ABOVE  start  LINES FOR OTHER DEVICES
    @REM   SAVE AS .BAT FILE
    @REM   ADJUST the -xpos  and -ypos to get the correct positions

    @REM   Oh yeah! I forgot.       Yo' Mama is so fat.......

     

    ====script above=========================

     

    This JPEG is of my laptop.   My console windows are probably bigger than most people have them.   But I like to read debugs and output quickly without so many word-wraps.

    ***  The color coding, I already had done in PUTTY.    Grey for routers. Default for Switches.  Guess which color for firewalls.  ;-)

    JPEG of   Section-I  of   Two Section Script

    Filed under: , , ,
    • Post Points: 50
  • 05-04-2012 3:28 PM In reply to

    Re: Putty/KITTY logon bat script

    JoeMama,

    Nice work. Thanks for sharing. Although I have heard of KITTY in this forum already, I have never tried to use, I think it is good time now to do some experiments.

    I have always used Putty and PuttyCM for tabbed Putty, but looks like this one adds more capabilities and has more features. Therefore, I will check it out.

    Thanks once again for sharing!

    Regards-

    • Post Points: 5
  • 05-04-2012 4:29 PM In reply to

    Re: Putty/KITTY logon bat script

    Is kitty tabbed?

    edit: Oh, I see that mtputty is a wrapper for putty or kitty, so I guess not.  Tabs FTW - having a dozen+ ssh/telnet windows open all day blows.

    • Post Points: 20
  • 05-04-2012 4:42 PM In reply to

    • JoeM
    • Top 25 Contributor
    • Joined on 04-15-2012
    • Guadalajara, Mexico
    • Elite
    • Points 18,760

    Re: Putty/KITTY logon bat script

    No.   Kitty is just Putty.

    The Window managers (tabbed) that I am aware of are puttyCM   and  MTputty   (I like this one. It is being updated).

    Just rename Kitty.exe to Putty.exe.....for these programs.   It will look just like putty.

     

    another little tool that  KITTY (putty) has that is interesting.......is a script/notepad......Shift+F2   This is not super big for me, but it is there at a keystroke.

     

    EDIT:    In a work environment, I usually prefer tabs -- for a cleaner desktop environment.

    But for labs, I realize that I really enjoy using  ALT-TAB to rotate quickly between windows   -- as well as being able to see more than one window at a time  SIDE-by-SIDE (i.e. debugs, noticing change/alerts/updates).    I will still use MTputty for some things.....after all KITTY is PUTTY.  ;-)

    • Post Points: 5
  • 07-11-2012 7:27 AM In reply to

    Re: Putty/KITTY logon bat script

    Hi,

    I am able to open the window using this:


    start "3" kitty.exe -load "PUT PUTTY DEVICE 3 NAME HERE"  -pass %passvar%   -xpos  25  -ypos  315

     

    How can I put a "grep ....filename" in the batch file ?

     

    Thanks

    • Post Points: 20
  • 07-11-2012 7:39 AM In reply to

    • JoeM
    • Top 25 Contributor
    • Joined on 04-15-2012
    • Guadalajara, Mexico
    • Elite
    • Points 18,760

    Re: Putty/KITTY logon bat script

    -load 

    This particular command in Putty (kitty) will load a profile that is already created in the Putty (kitty) client.

    It is possible to connect directly to a device without a device profile.  In that case, do not use -load  in the command.

     

    EDIT:   I have never used grep in a window's bat file.

    I found this link for the supposed Windows equivalant for grep.  FindStr

    http://scripthacks.wordpress.com/2008/09/16/grep-equivalent-for-windows-string-parsing/

    • Post Points: 5
Page 1 of 1 (6 items)
IEOC CCIE Forums Internetwork Expert CCIE Training
About IEOC | Terms of Use | RSS | Privacy Policy
© 2010 Internetwork Expert, Inc. All Rights Reserved