Launching SSH URL Into Putty

Posted: June 4, 2012 in Information Technology, Networking

I wanted to be able to launch SSH URLs directly from my PassSafe. What seems like such a simple thing turned out to be a pain. Basically, because putty is looking for a hostname or IP only from it’s CLI, the normal creation of a URL extension doesn’t work. I ended having to create a small batch file to strip out the URL guff and just leave the IP/Hostname.
So here is my little wrapper batch script. Drop this into your putty install location and change the path setting in it to reflect your install location.

set host=%1%
set host=%host:ssh://=%
set host=%host:/=%
set host=%host:”=%
Start /d “D:\program files\putty\” putty.exe -ssh %host%

Then, save the following as a .reg file and import into your registry, again changing the location in here to reflect what is in place on your system.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\ssh]
@=”URL:SSH Protocol”
“URL Protocol”=””

[HKEY_CLASSES_ROOT\ssh\DefaultIcon]

[HKEY_CLASSES_ROOT\ssh\shell]

[HKEY_CLASSES_ROOT\ssh\shell\open]

[HKEY_CLASSES_ROOT\ssh\shell\open\command]
@=”D:\\Program Files\\Putty\\wrapper.bat \”%1\””

Now, you should be able to jump straight into putty from a run prompt or web link in the format of ssh://

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s