HOWTO: Start a named PuTTY session from a Windows Shortcut

The blog is currently being ported from WordPress to over 12 years of static pages of content. If there's an article missing that you're hoping to see, please contact me and let me know and I'll prioritize getting it online.

April 23, 2010

I have Windows 7 on my laptop, but since I’m a die-hard Linux geek and haven’t got the patience to wait for anyone else to figure out all of the drivers needed for a clean, working Linux build on my M17x, I installed Cygwin. However, the limitation of running Cygwin in a DOS-like command line window that couldn’t be expanded beyond an 80-character width was a nuisance. Enter “puttytel” (downloadable on this page) which can connect to your local Cygwin installation in a PuTTY-like SSH terminal. Running this executable gives you a connection type of “cygterm” which you select along with a command of just a dash mark for a local shell. I called my Cygwin session __cygwin with dashes at the front so it would always be at the top of the list

Brilliant – now we can run PuTTY to launch Cygwin. But that still means a mind-numbing exercise of clicking the PuTTY icon, and having to double-click the “cygwin” profile I made (for scrollback, colored terminal, etc). So here’s how to solve it:

  1. Create a shortcut on your desktop for PuTTYtel.exe (right-button drag and drop the executable from Explorer to your Desktop, then select “Create Shortcuts here”)
  2. Right-click the shortcut icon and select Properties
  3. Under the “General” tab, give it a meaningful name
  4. Under the “Shortcut” tab, where it lists your target as C:\whateverpath\puttytel.exe change it to include a parameter of -load (single dash) and then a string (quoted if it contains spaces, etc) of which PuTTY profile name you want to autoload. Since mine was called __cygwin, my new Target line became this:
    C:\Program Files (x86)\putty\puttytel.exe" -load "__cygwin
  5. Click OK to save. You’re done.
  6. (optional) Right-click on the shortcut again and select “pin to taskbar”

Now you can simply click that icon on your desktop (or taskbar if you did step 6), and you have Cygwin (or any other PuTTY SSH session) immediately loaded and ready to go.