Skip to content

Instantly share code, notes, and snippets.



Created Dec 5, 2012
What would you like to do?
Automatic key loader for Pageant
Set shell = CreateObject("WScript.Shell")
start_folder = shell.ExpandEnvironmentStrings("%USERPROFILE%") + "\.ssh\"
Set files = CreateObject("Scripting.FileSystemObject").GetFolder(start_folder).Files
keys = ""
For Each file in files
If (Right(file.Name, 3) = "ppk") Then
keys = keys & """" & CStr(file.Path) & """ "
End If
shell.Run "pageant.exe " + keys, 1, false
wscript C:\path\to\pageant.loader.vbs
Tip: use mlin's StartupCPL
or add a shortcut to the vbs in the startup folder under start menu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment