20110118

Get Putty to handle SSH protocol on Windows

QUICK & DIRTY SSH PROTOCOL HANDLER


This allows Windows to handle the SSH protocol such as ssh://sshserver:2022

Add the following 2 files to the folder where you store putty - e.g. C:\Program Files\Putty\

To register SSH protocol in Windows, run:
ssh -reg
ssh.bat:
@echo off
set this=%~dp0

if %~1.==. goto HELP

if /i "%~1" equ "-r" goto Register

set host=%~1
set protocol=%host:~0,5%

if /i "%protocol%" equ "--reg" goto Register
set protocol=%host:~0,6%

:sshhere
if /i "%protocol%" neq "ssh://" goto ERROR

set sshHOST=%host:ssh://=%
set sshHOST=%sshHOST:/=%

Echo %sshHOST%
pause

:Open
Echo Starting...
start "SSH Host: %sshHOST%" /D"%this%" putty.exe -ssh %sshHOST%
Goto :EOF

:ERROR
msg * /time:10 "Invalid SSH URL - expected format is ssh://HOSTNAME"
Goto :EOF

:Register
reg import "%this%\SSHhandler.reg"  
reg add HKCR\ssh\DefaultIcon /ve /d "%this%PUTTY.EXE,1" /f>nul 
reg add HKCR\ssh\shell\open\command /ve /d "%this%ssh.bat \"%%1"" /f>nul 

Goto :EOF

:HELP
Echo Syntax: 
Echo Script Path: %~dpnx0 
Echo.
Echo -r OR --register
Echo Add this script as SSH Protocol handler in Windows Registry
Echo.
Echo ssh://[username@] 
Echo Runs putty.exe -ssh [username@]
Echo.

Goto :EOF

SSHhandler.reg:

Windows Registry Editor Version 5.00

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

[HKEY_CLASSES_ROOT\ssh\DefaultIcon]
@="C:\\Program Files\\putty\\PUTTY.EXE,1"

[HKEY_CLASSES_ROOT\ssh\shell\open\command]
@="C:\\Program Files\\putty\\ssh.bat \"%1\""

20090701

TIP: Wireless problem - just change the channel

If your having authentication issues with your wireless setup just try changing the channel.

Too Much Memories


White Screen of Death during Windows 7 64Bit setup with more than 2GB of RAM with AMD64 Chips with integrated Graphics card

Here I was thinking I had driver issues.

Certain chipsets/motherboards (AMD64) have an issue with more than 2 GB of RAM. Reduce it back to just 2GB... Bob's your uncle and Fanny's your aunt.

See this conversation for more info.

Or search Google.

20090630

Windows 7 woes

Making a PC boot back to Windows XP when Windows 7 fails to setup right

Typical Lazy Geek that I am rushed ahead to install my newly downloaded Windows 7 RC without RTFM.

Having never installed Vista (Windows 7's overweight older brother), I was in for a shock.


Every time I've installed Windows XP, it just kind of worked. Sure, a few drivers needed to be added after the fact, but your could always insert a CD or download whatever you were missing. Not Windows 7...


At least not for me |^)


So, here I was, eagerly awaiting the next stage Windows 7 setup process... Starting Windows... Blank White screen... Blank White Screen with a cursor... 5 minutes... same deal... 15 minutes...

*CRAP*

OK... So it failed.

Nevermind, I'll leave the partition in place, and just edit BOOT.ini to point back to the Windows XP partition...


BUT

there is no BOOT.ini in Windows 7 (not since Vista - because BOOT.ini just worked too well I guess).


* SIGH *

So, now, I had to manually select "Older Version of Windows" from the boot menu, or else my PC booted to a snowy summers day in Antarctica.

BUMMER
.


But I couldn't just give up...

I tried re-installing Windows 7 - nah-ah.

Read up on Windows Vista/7's crazy new boot manager. OK...


Couldn't get the recommended tools to work. D'OH!!

Finally, I tried in desperation the repair option after booting up on the Windows 7 DVD. No nice options there... And suddenly...
There it was...

An option to load drivers... A list of folders...
And what's this? An X: Drive... with some Windows 7 system folders... with some Windows 7 command line applications... and there it is, BCDedit - which just wouldn't work for me in Windows XP. And cmd.exe - good old DOS - still buried deep within windows.

So...
I started up CMD.exe (right click, open)... I CD to X:\Windows\System32\

I type BCDedit.exe /? and learn all there is about this command.

And there's the solution:
BCDedit /default {ntldr}

And now my PC boots into Windows XP by default...


Now to figure out how to repair the installation of Windows 7... And for that, I'll wager, I'll need to clear away the thin film of dust on those unused "Vista Driver" CDs I thought were useless... but kept anyway because I'm that sorta Geek.