<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Creating a Custom URL Protocol for SSH</title>
	<link>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/</link>
	<description>Ask the Windows Guru!</description>
	<pubDate>Sun, 01 Aug 2010 06:17:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Craig</title>
		<link>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-61884</link>
		<dc:creator>Craig</dc:creator>
		<pubDate>Tue, 22 Sep 2009 18:22:16 +0000</pubDate>
		<guid>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-61884</guid>
		<description>Nilpo,
Thanks for this.  Every bit of what I was looking for.  
Tim, Thank you for the add on for custom ports.  Everything works perfect.  

Craig.</description>
		<content:encoded><![CDATA[<p>Nilpo,<br />
Thanks for this.  Every bit of what I was looking for.<br />
Tim, Thank you for the add on for custom ports.  Everything works perfect.  </p>
<p>Craig.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manish</title>
		<link>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-61878</link>
		<dc:creator>Manish</dc:creator>
		<pubDate>Tue, 22 Sep 2009 15:45:14 +0000</pubDate>
		<guid>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-61878</guid>
		<description>Hi 

I have installed this SSH Protocol and it works fine in Google Chrome and Opera but it doesn't works in Firefox.

It gives error as"Unable to open connection to ssh Host does not exist" 

Any suggestion or clue, what could be wrong.

Thank you 
               Manish</description>
		<content:encoded><![CDATA[<p>Hi </p>
<p>I have installed this SSH Protocol and it works fine in Google Chrome and Opera but it doesn&#8217;t works in Firefox.</p>
<p>It gives error as&#8221;Unable to open connection to ssh Host does not exist&#8221; </p>
<p>Any suggestion or clue, what could be wrong.</p>
<p>Thank you<br />
               Manish</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Koopman</title>
		<link>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-60427</link>
		<dc:creator>Tim Koopman</dc:creator>
		<pubDate>Tue, 08 Sep 2009 03:02:49 +0000</pubDate>
		<guid>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-60427</guid>
		<description>Hi,

I have updated the script again as I also now required rdp urls to work. Also should be easy to add your own if needed.

helper.vbs
' Region Description
'
' Name: ssh.vbs
' Author: Robert Dunham (Nilpo)
'         Tim Koopman
' Website: http://www.nilpo.com
' Description: This script is for use with a custom protocol like ssh for Putty.
' 
' EndRegion

strSSH = "C:\URL_Helper\putty.exe"
strRDP = "mstsc /v:"
strPort = ""
strApp = ""

Select Case WScript.Arguments.Count
	Case 0
		WScript.Echo "No hostname provided.  Aborting operation."
		WScript.Quit
	Case Else
		Set colArgs = WScript.Arguments
		For i = 0 To WScript.Arguments.Count - 1
			strHost = " " &#38; WScript.Arguments.Item(i)
		Next
End Select

Set myRegExp = New RegExp
myRegExp.IgnoreCase = True
myRegExp.Global = True
myRegExp.Pattern = "(\w+)\://((?:\d{1,3}\.){3}\d{1,3})(?:\:(\d+))?"

Set myMatches = myRegExp.Execute(strHost)

If myMatches.count = 1 Then
	strApp = lcase(myMatches(0).SubMatches(0))
	strHost = myMatches(0).SubMatches(1)
	strPort = myMatches(0).SubMatches(2)

	Set WshShell = CreateObject("WScript.Shell")
	
	Select Case strApp
	Case "ssh"
		If strPort = "" Then
			strPort = "22"
		End If
		WshShell.Run """" &#38; strSSH &#38; """ -P " &#38; strPort &#38; " """ &#38; strHost &#38; """"
	Case "rdp"
		If strPort  "" Then
			strPort = ":" &#38; strPort
		End If
		WshShell.Run strRDP &#38; strHost &#38; strPort
	Case Else
		WScript.Echo "Invalid application " &#38; strApp
		WScript.Quit
	End Select
End If
_____________________________________________________
For each protocol you also need the registry updated. Save the below in a .reg file and install.

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]
@="wscript.exe C:\\URL_Helper\\helper.vbs %1"

[HKEY_CLASSES_ROOT\RDP]
@="URL:RDP Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\RDP\shell]

[HKEY_CLASSES_ROOT\RDP\shell\open]

[HKEY_CLASSES_ROOT\RDP\shell\open\command]
@="wscript.exe C:\\URL_Helper\\helper.vbs %1"</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I have updated the script again as I also now required rdp urls to work. Also should be easy to add your own if needed.</p>
<p>helper.vbs<br />
&#8216; Region Description<br />
&#8216;<br />
&#8216; Name: ssh.vbs<br />
&#8216; Author: Robert Dunham (Nilpo)<br />
&#8216;         Tim Koopman<br />
&#8216; Website: <a href="http://www.nilpo.com" rel="nofollow">http://www.nilpo.com</a><br />
&#8216; Description: This script is for use with a custom protocol like ssh for Putty.<br />
&#8216;<br />
&#8216; EndRegion</p>
<p>strSSH = &#8220;C:\URL_Helper\putty.exe&#8221;<br />
strRDP = &#8220;mstsc /v:&#8221;<br />
strPort = &#8220;&#8221;<br />
strApp = &#8220;&#8221;</p>
<p>Select Case WScript.Arguments.Count<br />
	Case 0<br />
		WScript.Echo &#8220;No hostname provided.  Aborting operation.&#8221;<br />
		WScript.Quit<br />
	Case Else<br />
		Set colArgs = WScript.Arguments<br />
		For i = 0 To WScript.Arguments.Count - 1<br />
			strHost = &#8221; &#8221; &amp; WScript.Arguments.Item(i)<br />
		Next<br />
End Select</p>
<p>Set myRegExp = New RegExp<br />
myRegExp.IgnoreCase = True<br />
myRegExp.Global = True<br />
myRegExp.Pattern = &#8220;(\w+)\://((?:\d{1,3}\.){3}\d{1,3})(?:\:(\d+))?&#8221;</p>
<p>Set myMatches = myRegExp.Execute(strHost)</p>
<p>If myMatches.count = 1 Then<br />
	strApp = lcase(myMatches(0).SubMatches(0))<br />
	strHost = myMatches(0).SubMatches(1)<br />
	strPort = myMatches(0).SubMatches(2)</p>
<p>	Set WshShell = CreateObject(&#8221;WScript.Shell&#8221;)</p>
<p>	Select Case strApp<br />
	Case &#8220;ssh&#8221;<br />
		If strPort = &#8220;&#8221; Then<br />
			strPort = &#8220;22&#8243;<br />
		End If<br />
		WshShell.Run &#8220;&#8221;"&#8221; &amp; strSSH &amp; &#8220;&#8221;" -P &#8221; &amp; strPort &amp; &#8221; &#8220;&#8221;" &amp; strHost &amp; &#8220;&#8221;"&#8221;<br />
	Case &#8220;rdp&#8221;<br />
		If strPort  &#8220;&#8221; Then<br />
			strPort = &#8220;:&#8221; &amp; strPort<br />
		End If<br />
		WshShell.Run strRDP &amp; strHost &amp; strPort<br />
	Case Else<br />
		WScript.Echo &#8220;Invalid application &#8221; &amp; strApp<br />
		WScript.Quit<br />
	End Select<br />
End If<br />
_____________________________________________________<br />
For each protocol you also need the registry updated. Save the below in a .reg file and install.</p>
<p>Windows Registry Editor Version 5.00</p>
<p>[HKEY_CLASSES_ROOT\SSH]<br />
@=&#8221;URL:SSH Protocol&#8221;<br />
&#8220;URL Protocol&#8221;=&#8221;"</p>
<p>[HKEY_CLASSES_ROOT\SSH\shell]</p>
<p>[HKEY_CLASSES_ROOT\SSH\shell\open]</p>
<p>[HKEY_CLASSES_ROOT\SSH\shell\open\command]<br />
@=&#8221;wscript.exe C:\\URL_Helper\\helper.vbs %1&#8243;</p>
<p>[HKEY_CLASSES_ROOT\RDP]<br />
@=&#8221;URL:RDP Protocol&#8221;<br />
&#8220;URL Protocol&#8221;=&#8221;"</p>
<p>[HKEY_CLASSES_ROOT\RDP\shell]</p>
<p>[HKEY_CLASSES_ROOT\RDP\shell\open]</p>
<p>[HKEY_CLASSES_ROOT\RDP\shell\open\command]<br />
@=&#8221;wscript.exe C:\\URL_Helper\\helper.vbs %1&#8243;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Mroz</title>
		<link>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-31543</link>
		<dc:creator>Joe Mroz</dc:creator>
		<pubDate>Fri, 20 Mar 2009 16:26:20 +0000</pubDate>
		<guid>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-31543</guid>
		<description>Hi,

   I am trying to use Reflection 12 instead of putty for the default client and it requires a /w switch.   I've tried a number of places in the vsb script to add the switch, but just cannot seem to find the right spot.

Here are some of my tries.
strSSH = "C:\Program Files\Reflection\r2win.exe /w" 
or
WshShell.Run """" &#38; strSSH &#38; "/w" &#38; """ """ &#38; CleanHostname(strHost) &#38; """"

The above change causes the return of the Error "the system cannot find the file specified"

Once I click "okay" to the error message, Relections starts up without any connection info.

If I don't have the /w switch anywhere then I get a settings file not found message.  This is the same message that I get when I telnet without the /w switch.  To fix the telnet I was able to put the switch in the URL: telnet protocol in my Windows registered file types.

Thanks in advance for any help
Joe</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>   I am trying to use Reflection 12 instead of putty for the default client and it requires a /w switch.   I&#8217;ve tried a number of places in the vsb script to add the switch, but just cannot seem to find the right spot.</p>
<p>Here are some of my tries.<br />
strSSH = &#8220;C:\Program Files\Reflection\r2win.exe /w&#8221;<br />
or<br />
WshShell.Run &#8220;&#8221;"&#8221; &amp; strSSH &amp; &#8220;/w&#8221; &amp; &#8220;&#8221;" &#8220;&#8221;" &amp; CleanHostname(strHost) &amp; &#8220;&#8221;"&#8221;</p>
<p>The above change causes the return of the Error &#8220;the system cannot find the file specified&#8221;</p>
<p>Once I click &#8220;okay&#8221; to the error message, Relections starts up without any connection info.</p>
<p>If I don&#8217;t have the /w switch anywhere then I get a settings file not found message.  This is the same message that I get when I telnet without the /w switch.  To fix the telnet I was able to put the switch in the URL: telnet protocol in my Windows registered file types.</p>
<p>Thanks in advance for any help<br />
Joe</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nilpo</title>
		<link>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-23726</link>
		<dc:creator>Nilpo</dc:creator>
		<pubDate>Wed, 28 Jan 2009 19:36:48 +0000</pubDate>
		<guid>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-23726</guid>
		<description>Hi, Chuck.

So you're saying that you need this script to not only connect with Putty, but also to automate part of that connection?  If I'm understanding you correctly, you need this script to send commands to Putty to connect to a remote device after the initial connection is made.</description>
		<content:encoded><![CDATA[<p>Hi, Chuck.</p>
<p>So you&#8217;re saying that you need this script to not only connect with Putty, but also to automate part of that connection?  If I&#8217;m understanding you correctly, you need this script to send commands to Putty to connect to a remote device after the initial connection is made.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chuck holman</title>
		<link>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-23710</link>
		<dc:creator>chuck holman</dc:creator>
		<pubDate>Wed, 28 Jan 2009 16:08:55 +0000</pubDate>
		<guid>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-23710</guid>
		<description>Nilpo, thanks for the modification.  However, it didn't work.  Actually, it failed to open a session or respond to keyboard input.  I renamed the original script file and saved this modified file as the same name "SSH.VBS".  When I clicked on the link in the browser, the application (putty) launched but, didn't open a session or respond to any keyboard entry.  I deleted the modified file and renamed the original file back to SSH.VBS and the application functioned as before; opened a session only to the terminal server and no farther.  I did note that in the modified file, you made mention of a port number "2018".  I was not attempting to access any device on that port.  How this application should work is to open a session through the terminal server to the device located on the port number that is configured in the data field of the link.  Port numbers could range from 2000 - 3000 depending upon the type of terminal server used.

Thank you.
Chuck</description>
		<content:encoded><![CDATA[<p>Nilpo, thanks for the modification.  However, it didn&#8217;t work.  Actually, it failed to open a session or respond to keyboard input.  I renamed the original script file and saved this modified file as the same name &#8220;SSH.VBS&#8221;.  When I clicked on the link in the browser, the application (putty) launched but, didn&#8217;t open a session or respond to any keyboard entry.  I deleted the modified file and renamed the original file back to SSH.VBS and the application functioned as before; opened a session only to the terminal server and no farther.  I did note that in the modified file, you made mention of a port number &#8220;2018&#8243;.  I was not attempting to access any device on that port.  How this application should work is to open a session through the terminal server to the device located on the port number that is configured in the data field of the link.  Port numbers could range from 2000 - 3000 depending upon the type of terminal server used.</p>
<p>Thank you.<br />
Chuck</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nilpo</title>
		<link>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-23268</link>
		<dc:creator>Nilpo</dc:creator>
		<pubDate>Mon, 26 Jan 2009 19:54:53 +0000</pubDate>
		<guid>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-23268</guid>
		<description>Hi, Chuck.  Try this.

&lt;pre lang="vb"&gt;' Name: ssh.vbs
' Author: Robert Dunham (Nilpo)
' Website: http://www.nilpo.com
' Description: This script is for use with a custom SSH protocol for Putty.

strSSH = "C:\ssh\putty.exe"
strPort = "2018"

Select Case WScript.Arguments.Count
	Case 0
		WScript.Echo "No hostname provided. Aborting SSH operation."
		WScript.Quit
	Case Else
		Set colArgs = WScript.Arguments
		For i = 0 To WScript.Arguments.Count - 1
			strHost = " " &#038; WScript.Arguments.Item(i)
		Next
End Select

Set WshShell = CreateObject("WScript.Shell")
strHost = CleanHostname(strHost)
WshShell.Run """" &#038; strSSH &#038; """ -P " &#038; strPort &#038; " """ &#038; strHost &#038; """"
WScript.Quit

Function CleanHostname(strHost)
	strHost = Trim(strHost)
	'Remove protocol if it was passed
	If InStr(strHost, "ssh://") = 1 Then
		strHost = Right(strHost, Len(strHost) - 6)
	End If
	'Remove trailing slash if present
	If InStrRev(strHost, "/") = Len(strHost) Then
		strHost = Left(strHost, Len(strHost) - 1)
	End If
	If InStrRev(strHost, ":") &gt; 0 Then
		strPort = Right(strHost, Len(strHost) - InStrRev(strHost, ":"))
		strHost = Left(strHost, InStrRev(strHost, ":") - 1)
	End If
	'Return cleaned hostname
	CleanHostname = strHost
End Function&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hi, Chuck.  Try this.</p>

<div class="wp_syntax"><div class="code"><pre class="vb"><span style="color: #808080;">' Name: ssh.vbs</span>
<span style="color: #808080;">' Author: Robert Dunham (Nilpo)</span>
<span style="color: #808080;">' Website: http://www.nilpo.com</span>
<span style="color: #808080;">' Description: This script is for use with a custom SSH protocol for Putty.</span>
&nbsp;
strSSH = <span style="color: #ff0000;">&quot;C:\ssh\putty.exe&quot;</span>
strPort = <span style="color: #ff0000;">&quot;2018&quot;</span>
&nbsp;
Select <span style="color: #b1b100;">Case</span> WScript.<span style="color: #66cc66;">Arguments</span>.<span style="color: #b1b100;">Count</span>
	<span style="color: #b1b100;">Case</span> <span style="color: #cc66cc;">0</span>
		WScript.<span style="color: #66cc66;">Echo</span> <span style="color: #ff0000;">&quot;No hostname provided. Aborting SSH operation.&quot;</span>
		WScript.<span style="color: #66cc66;">Quit</span>
	<span style="color: #b1b100;">Case</span> <span style="color: #b1b100;">Else</span>
		<span style="color: #b1b100;">Set</span> colArgs = WScript.<span style="color: #66cc66;">Arguments</span>
		<span style="color: #b1b100;">For</span> i = <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">To</span> WScript.<span style="color: #66cc66;">Arguments</span>.<span style="color: #b1b100;">Count</span> - <span style="color: #cc66cc;">1</span>
			strHost = <span style="color: #ff0000;">&quot; &quot;</span> &amp; WScript.<span style="color: #66cc66;">Arguments</span>.<span style="color: #66cc66;">Item</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>
		<span style="color: #b1b100;">Next</span>
<span style="color: #b1b100;">End</span> Select
&nbsp;
<span style="color: #b1b100;">Set</span> WshShell = <span style="color: #b1b100;">CreateObject</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;WScript.Shell&quot;</span><span style="color: #66cc66;">&#41;</span>
strHost = CleanHostname<span style="color: #66cc66;">&#40;</span>strHost<span style="color: #66cc66;">&#41;</span>
WshShell.<span style="color: #66cc66;">Run</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #ff0000;">&quot;&quot;</span> &amp; strSSH &amp; <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #ff0000;">&quot; -P &quot;</span> &amp; strPort &amp; <span style="color: #ff0000;">&quot; &quot;</span><span style="color: #ff0000;">&quot;&quot;</span> &amp; strHost &amp; <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #ff0000;">&quot;&quot;</span>
WScript.<span style="color: #66cc66;">Quit</span>
&nbsp;
<span style="color: #b1b100;">Function</span> CleanHostname<span style="color: #66cc66;">&#40;</span>strHost<span style="color: #66cc66;">&#41;</span>
	strHost = <span style="color: #b1b100;">Trim</span><span style="color: #66cc66;">&#40;</span>strHost<span style="color: #66cc66;">&#41;</span>
	<span style="color: #808080;">'Remove protocol if it was passed</span>
	<span style="color: #b1b100;">If</span> <span style="color: #b1b100;">InStr</span><span style="color: #66cc66;">&#40;</span>strHost, <span style="color: #ff0000;">&quot;ssh://&quot;</span><span style="color: #66cc66;">&#41;</span> = <span style="color: #cc66cc;">1</span> <span style="color: #b1b100;">Then</span>
		strHost = <span style="color: #b1b100;">Right</span><span style="color: #66cc66;">&#40;</span>strHost, <span style="color: #b1b100;">Len</span><span style="color: #66cc66;">&#40;</span>strHost<span style="color: #66cc66;">&#41;</span> - <span style="color: #cc66cc;">6</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span>
	<span style="color: #808080;">'Remove trailing slash if present</span>
	<span style="color: #b1b100;">If</span> <span style="color: #b1b100;">InStrRev</span><span style="color: #66cc66;">&#40;</span>strHost, <span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #66cc66;">&#41;</span> = <span style="color: #b1b100;">Len</span><span style="color: #66cc66;">&#40;</span>strHost<span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">Then</span>
		strHost = <span style="color: #b1b100;">Left</span><span style="color: #66cc66;">&#40;</span>strHost, <span style="color: #b1b100;">Len</span><span style="color: #66cc66;">&#40;</span>strHost<span style="color: #66cc66;">&#41;</span> - <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span>
	<span style="color: #b1b100;">If</span> <span style="color: #b1b100;">InStrRev</span><span style="color: #66cc66;">&#40;</span>strHost, <span style="color: #ff0000;">&quot;:&quot;</span><span style="color: #66cc66;">&#41;</span> &gt; <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">Then</span>
		strPort = <span style="color: #b1b100;">Right</span><span style="color: #66cc66;">&#40;</span>strHost, <span style="color: #b1b100;">Len</span><span style="color: #66cc66;">&#40;</span>strHost<span style="color: #66cc66;">&#41;</span> - <span style="color: #b1b100;">InStrRev</span><span style="color: #66cc66;">&#40;</span>strHost, <span style="color: #ff0000;">&quot;:&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
		strHost = <span style="color: #b1b100;">Left</span><span style="color: #66cc66;">&#40;</span>strHost, <span style="color: #b1b100;">InStrRev</span><span style="color: #66cc66;">&#40;</span>strHost, <span style="color: #ff0000;">&quot;:&quot;</span><span style="color: #66cc66;">&#41;</span> - <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span>
	<span style="color: #808080;">'Return cleaned hostname</span>
	CleanHostname = strHost
<span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Function</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: chuck holman</title>
		<link>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-23261</link>
		<dc:creator>chuck holman</dc:creator>
		<pubDate>Mon, 26 Jan 2009 16:49:57 +0000</pubDate>
		<guid>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-23261</guid>
		<description>Thanks Nilpo and Tim.  However, I'm not a "coder" and wouldn't know what to do with what was written.  If it is already in the download / install link, then I have it and it does not behave as I would want.  what next?  thanks.  Chuck</description>
		<content:encoded><![CDATA[<p>Thanks Nilpo and Tim.  However, I&#8217;m not a &#8220;coder&#8221; and wouldn&#8217;t know what to do with what was written.  If it is already in the download / install link, then I have it and it does not behave as I would want.  what next?  thanks.  Chuck</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nilpo</title>
		<link>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-22803</link>
		<dc:creator>Nilpo</dc:creator>
		<pubDate>Fri, 23 Jan 2009 00:24:09 +0000</pubDate>
		<guid>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-22803</guid>
		<description>Take a look at Tim Koopman's post above.  He has made a modification that allows you to specify a custom port number.  Let me know how that works out for you.</description>
		<content:encoded><![CDATA[<p>Take a look at Tim Koopman&#8217;s post above.  He has made a modification that allows you to specify a custom port number.  Let me know how that works out for you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chuck holman</title>
		<link>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-22792</link>
		<dc:creator>chuck holman</dc:creator>
		<pubDate>Thu, 22 Jan 2009 23:14:16 +0000</pubDate>
		<guid>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-22792</guid>
		<description>I used the install package at the end of the article.  It worked well.  However, our my specific usage is to access a device through a terminal server (communications server) i.e a router, switch, etc.  The typical host string is... a.b.c.d:port# or 10.10.10.1:2018.  
With the current install configuration, the port number is disregarded.  I need to have the ssh app i.e. Putty, open the session all the way through.  Port numbers vary depending upon the link so... ... any help would be greatly appreciated.  Thanks.  Chuck</description>
		<content:encoded><![CDATA[<p>I used the install package at the end of the article.  It worked well.  However, our my specific usage is to access a device through a terminal server (communications server) i.e a router, switch, etc.  The typical host string is&#8230; a.b.c.d:port# or 10.10.10.1:2018.<br />
With the current install configuration, the port number is disregarded.  I need to have the ssh app i.e. Putty, open the session all the way through.  Port numbers vary depending upon the link so&#8230; &#8230; any help would be greatly appreciated.  Thanks.  Chuck</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LePiaf</title>
		<link>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-15022</link>
		<dc:creator>LePiaf</dc:creator>
		<pubDate>Tue, 28 Oct 2008 07:24:30 +0000</pubDate>
		<guid>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-15022</guid>
		<description>Thank you for your article. It's very good. I search very long time how to create my own protocol. I customise your script for my usage. 

LePiaf</description>
		<content:encoded><![CDATA[<p>Thank you for your article. It&#8217;s very good. I search very long time how to create my own protocol. I customise your script for my usage. </p>
<p>LePiaf</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nilpo</title>
		<link>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-1597</link>
		<dc:creator>Nilpo</dc:creator>
		<pubDate>Tue, 26 Feb 2008 01:21:40 +0000</pubDate>
		<guid>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-1597</guid>
		<description>Looks good, Tim.  Thanks for the addition!</description>
		<content:encoded><![CDATA[<p>Looks good, Tim.  Thanks for the addition!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Koopman</title>
		<link>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-1579</link>
		<dc:creator>Tim Koopman</dc:creator>
		<pubDate>Mon, 25 Feb 2008 07:09:25 +0000</pubDate>
		<guid>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-1579</guid>
		<description>Hi,

I made a small mod to your ssh.vbs script to enable it to accept custom ports. Did it quick and dirty could be done a bit better but works.

Tim

' Region Description
'
' Name: ssh.vbs
' Author: Robert Dunham (Nilpo)
' Website: http://www.nilpo.com
' Description: This script is for use with a custom SSH protocol for Putty.
' 
' EndRegion

strSSH = "C:\ssh\putty.exe"
strPort = "22"

Select Case WScript.Arguments.Count
	Case 0
		WScript.Echo "No hostname provided.  Aborting SSH operation."
		WScript.Quit
	Case Else
		Set colArgs = WScript.Arguments
		For i = 0 To WScript.Arguments.Count - 1
			strHost = " " &#38; WScript.Arguments.Item(i)
		Next
End Select

Set WshShell = CreateObject("WScript.Shell")
strHost = CleanHostname(strHost)
WshShell.Run """" &#38; strSSH &#38; """ -P " &#38; strPort &#38; " """ &#38; strHost &#38; """"
WScript.Quit

Function CleanHostname(strHost)
	strHost = Trim(strHost)
	'Remove protocol if it was passed
	If InStr(strHost, "ssh://") = 1 Then
		strHost = Right(strHost, Len(strHost) - 6)
	End If
	'Remove trailing slash if present
	If InStrRev(strHost, "/") = Len(strHost) Then
		strHost = Left(strHost, Len(strHost) - 1)
	End If
	If InStrRev(strHost, ":") &#62; 0 Then
		strPort = right(strHost, Len(strHost) - InStrRev(strHost, ":"))
		strHost = Left(strHost, InStrRev(strHost, ":") - 1)
	End If
	'Return cleaned hostname
	CleanHostname = strHost
End Function</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I made a small mod to your ssh.vbs script to enable it to accept custom ports. Did it quick and dirty could be done a bit better but works.</p>
<p>Tim</p>
<p>&#8216; Region Description<br />
&#8216;<br />
&#8216; Name: ssh.vbs<br />
&#8216; Author: Robert Dunham (Nilpo)<br />
&#8216; Website: <a href="http://www.nilpo.com" rel="nofollow">http://www.nilpo.com</a><br />
&#8216; Description: This script is for use with a custom SSH protocol for Putty.<br />
&#8216;<br />
&#8216; EndRegion</p>
<p>strSSH = &#8220;C:\ssh\putty.exe&#8221;<br />
strPort = &#8220;22&#8243;</p>
<p>Select Case WScript.Arguments.Count<br />
	Case 0<br />
		WScript.Echo &#8220;No hostname provided.  Aborting SSH operation.&#8221;<br />
		WScript.Quit<br />
	Case Else<br />
		Set colArgs = WScript.Arguments<br />
		For i = 0 To WScript.Arguments.Count - 1<br />
			strHost = &#8221; &#8221; &amp; WScript.Arguments.Item(i)<br />
		Next<br />
End Select</p>
<p>Set WshShell = CreateObject(&#8221;WScript.Shell&#8221;)<br />
strHost = CleanHostname(strHost)<br />
WshShell.Run &#8220;&#8221;"&#8221; &amp; strSSH &amp; &#8220;&#8221;" -P &#8221; &amp; strPort &amp; &#8221; &#8220;&#8221;" &amp; strHost &amp; &#8220;&#8221;"&#8221;<br />
WScript.Quit</p>
<p>Function CleanHostname(strHost)<br />
	strHost = Trim(strHost)<br />
	&#8216;Remove protocol if it was passed<br />
	If InStr(strHost, &#8220;ssh://&#8221;) = 1 Then<br />
		strHost = Right(strHost, Len(strHost) - 6)<br />
	End If<br />
	&#8216;Remove trailing slash if present<br />
	If InStrRev(strHost, &#8220;/&#8221;) = Len(strHost) Then<br />
		strHost = Left(strHost, Len(strHost) - 1)<br />
	End If<br />
	If InStrRev(strHost, &#8220;:&#8221;) &gt; 0 Then<br />
		strPort = right(strHost, Len(strHost) - InStrRev(strHost, &#8220;:&#8221;))<br />
		strHost = Left(strHost, InStrRev(strHost, &#8220;:&#8221;) - 1)<br />
	End If<br />
	&#8216;Return cleaned hostname<br />
	CleanHostname = strHost<br />
End Function</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nilpo</title>
		<link>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-17</link>
		<dc:creator>Nilpo</dc:creator>
		<pubDate>Fri, 10 Aug 2007 16:55:32 +0000</pubDate>
		<guid>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-17</guid>
		<description>Thank you so much, Kyle.  It was a pleasure.  I'm glad I could help!</description>
		<content:encoded><![CDATA[<p>Thank you so much, Kyle.  It was a pleasure.  I&#8217;m glad I could help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kavernon</title>
		<link>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-16</link>
		<dc:creator>kavernon</dc:creator>
		<pubDate>Fri, 10 Aug 2007 15:36:13 +0000</pubDate>
		<guid>http://www.nilpo.com/2007/08/windows-xp/creating-a-custom-url-protocol-for-ssh/#comment-16</guid>
		<description>Robert,

Thanks so much for your help.  The insight you gave into the nature of the issue along with the suggestions and ultimately a packaged software solution was exactly what I was looking for.  Keep up the great work!

Kyle</description>
		<content:encoded><![CDATA[<p>Robert,</p>
<p>Thanks so much for your help.  The insight you gave into the nature of the issue along with the suggestions and ultimately a packaged software solution was exactly what I was looking for.  Keep up the great work!</p>
<p>Kyle</p>
]]></content:encoded>
	</item>
</channel>
</rss>
