launch putty from browser with telnet protocol

What do we need to do?

1.Register a new protocol (in our case, let’s call it “telnet”) to Windows’s registry.
2.Create a batch file that can take in strings such as “telnet://google.com/” and massage them and pass them on to putty.exe
3.Point the registry modification to that batch file.


1. To edit the registry is to create a .reg file, save it, right click it and select merge.

Here is an example .reg file which points the protocol “telnet” to a batch file located at “C:/mliao/putty_util.bat” :

my.reg:


REGEDIT4
[HKEY_CLASSES_ROOT\telnet]
@="URL:telnet Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\telnet\shell]
[HKEY_CLASSES_ROOT\telnet\shell\open]
[HKEY_CLASSES_ROOT\telnet\shell\open\command]
@="\"C:\mliao\putty_util.bat\" %1"

Now save my.reg locally, right click it, and select merge.

Unfortunately, PuTTY does not understand arguments which start off with “telnet://” .

2. As a result, we must use a batch file (putty_util.bat) to remove the “telnet://” and any other oddities.

Here is the batch file:

putty_util.bat:
@echo off
set var=%1
set extract=%var:~9,-1%
"C:\mliao\putty.exe" %extract%

set extract=%var:~9,-1% is telling us to remove the first 9 characters and the last character from var and place that value in extract.

Reference:

http://johnsofteng.wordpress.com/2009/05/12/launch-putty-from-browser/

3. In addition.

"Telnet--The Telnet protocol handler is no longer supported in Internet
Explorer 7."


You can turn it back on in IE7 but it requires a Registry tweak. If you are
comfortable working with the Registry, you can use the Registry Editor to
navigate to the following Key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet
Explorer\Main\FeatureControl\FEATURE_DISABLE_TELNE T_PROTOCOL

DWORD Name = iexplore.exe
DWORD Valure = 0(Zero)

Or, you can download a .reg file:

http://library.osu.edu/sites/it/CSS/faqtips/ie7_telnet_fix.php

 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值