In Windows you can register “url handlers”. These are programs that are run when you try to open a URL (via Start->Run for example). “http://” for example is registered to Internet Explorer by default. “telnet://” also works. This is especially useful in combination with the URL-field of KeePass. Double-clicking on this field tries to “open” the specified URL.

However, “ssh://” is not a standard registered protocol. I’d like Putty to handle this. Also, “telnet://” gets you the standard windows telnet client instead of putty. Putty can be called with command line arguments. Supplying the “telnet://” url as a parameter works, but “ssh://” does not.

Hence, I wrote a very small wrapper program to accept “ssh://” URL’s and convert them to Putty command line arguments:

Some notes:

  • The registry commands assume Putty and the wrapper are installed in C:\Progs\SSH. If this is not the case, you need to change the .reg-files accordingly
  • The wrapper-program assumes putty.exe to be in the same directory as itself

3 Comments

  1. Bjørn says:

    Just a tip:
    You should “assume” that people just install putty with the default settings.
    Assuming anything else, will render it useless unless people edit the reg-files. :)

    Cheers for making the regfiles tho :P

  2. Niobos says:

    Bjørn,

    I agree. But since putty is normally downloaded as a simple .exe without installer, there is no default installation path. Also, editing a text-file is not very hard.

    Niobos

  3. Felix says:

    Nice work!

    Two notes:
    1) I had to add the directory that contains putty.exe and ssh-to-putty.exe to the PATH variable to make it work. Before that, ssh-to-putty could not find putty, even though both files were located in the same directory.
    2) It would be nice if the ssh-to-putty window would close after starting putty.

    Anyway, thank you very much :)

    Best regards
    Felix

Leave a Reply