Tue, 31 Jan 2006 20:52:00 GMT

URL Protocol Launcher

In order to make my Active Desktop actually useful for shortcuts and functions that I commonly do, I wrote a little utility which translates the URL Protocol invocation created by clicking on an HREF in an HTML file.

And you have these entries in your registry (cut and paste into a reg file and merge it):

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\ssh]
@="URL:SSH Protocol"
"URL Protocol"=""
"EditFlags"=dword:00000002
"BrowserFlags"=dword:00000008
[HKEY_CLASSES_ROOT\ssh\DefaultIcon]
@="%SystemRoot%\\system32\\url.dll,0"
[HKEY_CLASSES_ROOT\ssh\shell]
@="open"
[HKEY_CLASSES_ROOT\ssh\shell\open]
[HKEY_CLASSES_ROOT\ssh\shell\open\command]
@="C:\\bin\\launchurl.exe \"%1\""

This will invoke the utility I wrote which will then access the following registry keys (also cut, paste into a reg file and merge):

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\URL Protocol Launcher]
"ssh"="C:\\PROGRA~1\\Putty\\putty.exe -load \"%1\""
"cmdshell"="C:\\bat\\shell.cmd \"%1\""
"ue"="\"C:\\Program Files\\UltraEdit\\uedit32.exe\" \"%1\""
"google"="C:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE -url \"http://www.google.com/search?q=%1\""
"vnc"="\"C:\\Program Files\\TightVNC\\vncviewer.exe\" -compresslevel 5 -quality 5 %1"

These keys define the actual program to call with all the proper command line switches and it supports a single variable replacement.

You have your active desktop HTML with a link in it like this:

<a target="_top" href="ssh:somehost">Somehost (SSH)</a>

Which invokes:

"C:\bin\launchurl.exe ssh:somehost"

which will then in turn launch

"C:\PROGRA~1\Putty\putty -load "somehost"

And most importantly this will do all of this with no popups from explorer, complaining that it can't find the proper file! This method is completely extensible to any protocol. You just need to add it like I added ssh: above.

Here's the zip file. You need to install the launchurl.exe binary somewhere and then change the paths in the reg file to match that path. Also, double check your paths in the URL Protocol Launcher key.