Created
March 18, 2010 15:43
-
-
Save spraints/336483 to your computer and use it in GitHub Desktop.
Creates registry entries for a saved putty session with a window 80x40 and the ssh agent forwarded.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
set alias=%1 | |
set host=%2 | |
set user=%3 | |
if "" == "%alias%" goto :help | |
if "" == "%host%" set host=%alias% | |
if "" == "%user%" set user=%USERNAME% | |
rem echo Host: %host% | |
rem echo User: %user% | |
set prompt=- | |
set key=HKCU\Software\SimonTatham\PuTTY\Sessions\%alias% | |
call :setkey UserName %user% REG_SZ | |
call :setkey HostName %host% REG_SZ | |
call :setkey AgentFwd 1 REG_DWORD | |
call :setkey TermWidth 0x0050 REG_DWORD | |
call :setkey TermHeight 0x002c REG_DWORD | |
rem reg query %key% | |
goto :eof | |
:setkey | |
@echo on | |
reg add %key% /v %1 /d %2 /t %3 /f | |
@echo off | |
goto :eof | |
:help | |
echo Usage: %0 putty-alias [hostname [username]] | |
echo hostname will default to the aliased name | |
echo username will default to %USERNAME% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@reg query HKCU\Software\SimonTatham\PuTTY\Sessions /s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment