I've added this entry into the context menue of an USB stick via autorun.inf
:
[AutoRun]
shell\pageant=Activate SSH Key
shell\pageant\command=PuTTY\pageant.exe PuTTY\davids.ppk
Both PuTTY\pageant.exe
and PuTTY\davids.ppk
are files on the USB stick and should be picked up from there.
When I run this in a shell from the root of the stick it works as intended. But starting it from the menu it tries to load the key from C:\Windows\system32\PuTTY\davids.ppk
(checked with Process Monitor).
Trying to use a simple cmd script resulted in this output:
C:\Windows\system32>cd PuTTY Das System kann den angegebenen Pfad nicht finden. C:\Windows\system32>pageant.exe davids.ppk Der Befehl "pageant.exe" ist entweder falsch geschrieben oder konnte nicht gefunden werden.
Is there a way to get this working properly? I guess it should be able to pass the drive letter or get the explorer to use the stick as working directory, but I don't know how. Since I want to use the stick on the go, I'd rather avoid hardcoding my local drive letter.