How to get Internet Explorer to handle custom protocol handlers correctly?

I would like to create a site that I create to open PuTTYon type URLs ssh://0.0.0.0. I got this feature working in Chrome and Firefox, but getting the following errors in Internet Explorer:

Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access this item.

Followed by:

Unable to open this helper application for ssh://0.0.0.0/.

The protocol specified in this address is not valid. Make sure the address is correct, and try again.

Here are my registry keys:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\ssh]
@="URL:SSH Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\ssh\shell]

[HKEY_CLASSES_ROOT\ssh\shell\open]

[HKEY_CLASSES_ROOT\ssh\shell\open\command]
@="cmd /k set in=\"%l\" & call set in=%%in:ssh:=%% & call set in=%%in:/=%% & call \"C:\\Program Files (x86)\\PuTTY\\putty.exe\" %%in%% & exit"

I did a quick experiment, and it looks like the problem is with cmdand call. As soon as I delete them, I will get the expected result. However, I still need to do string manipulation, since PuTTY (and the same situation for URLs vncusing RealVNC VNC Viewer) expects only a host without a protocol prefix.

: , cmd, . call .

+4
1

, , cmd.exe Internet Explorer. PowerShell. - PuTTY, , :

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\ssh]
@="URL:SSH Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\ssh\shell]

[HKEY_CLASSES_ROOT\ssh\shell\open]

[HKEY_CLASSES_ROOT\ssh\shell\open\command]
@="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -Command \"$uri = [System.Uri]'%l';&\"${env:ProgramFiles}\\PuTTY\\putty.exe\" -P $uri.Port $uri.GetComponents([System.UriComponents]::UserInfo -bor [System.UriComponents]::Host, [System.UriFormat]::UriEscaped)\""

SSH VNC .

+5

All Articles