I wrote this one liner that allow me to start pageant and load all .ppk files from my %HOMEPATH%/.ssh folder
Here is it:
start pageant && timeout 1 && FOR %k in ("%HOMEPATH%\.ssh\*.ppk") do start pageant %k
The timeout is there to prevent multiple pageant instances ( WIN7 only, I know )
So this works when just running it from the command line. Pageant starts and all keys load.
But now i want to put it in a .bat file so that i can add it in my startup folder.
I tried all these combinations:
start pageant && timeout 1 && FOR %k in ("%HOMEPATH%\.ssh\*.ppk") do start pageant %k
start pageant
timeout 1
FOR %k in ("%HOMEPATH%\.ssh\*.ppk") do start pageant %k
start pageant && timeout 1 && FOR %k in ("C:%HOMEPATH%\.ssh\*.ppk") do start pageant %k
start pageant
timeout 1
FOR %k in ("C:%HOMEPATH%\.ssh\*.ppk") do start pageant %k
start pageant && timeout 1 && FOR %k in ("C:\Users\Willem\.ssh\*.ppk") do start pageant %k
start pageant
timeout 1
FOR %k in ("C:\Users\Willem\.ssh\*.ppk") do start pageant %k
I also tried several options on FOR and tried removing and adding start everywhere. And many more variations, i keep getting this error when the FOR loops runs
HOMEPATHk was unexpected at this time.
It's just not working when i try to run it through a .bat file. pageant.exe is added to my system32 folder, I'm using the latest stable version.
What rookie mistake am i missing here that this won't run from a batch file ?
%%k