justinmassiot
7/11/2018 - 12:41 PM

Auto-load keys into Pageant

@echo off

set pageant_path=pageant.exe
REM Add the program to your system path if you want it te be accessible globally

REM Start Pageant alone without waiting for it to return
start %pageant_path%

timeout 5

REM Load all the keys into Pageant. Use keys with no passphrase if you don't want to be prompted each time.
REM %%~na is the file name without extension and %%~xa is the file extension
for /f %%a in ('dir /b') do (
	if /i %%~xa==.ppk (
		cmd /c %pageant_path% %%a
    echo The following key is now loaded into Pageant:  %%a
	)
)