3

When we create our own public key using GNUPG tool, It is working perfectly fine in "WScript.shell" in vb script but when we importing someone else public key using command "gpg --import /public key file path", it is not working from shall script(Always provide ExitCode = 2) but when we run the same command directly into command prompt it is working fine.

I already set the imported public key trust level to "ultimate" but still no luck. A little help would be highly appreciable.

Command :

Set resultObj = objShell.Exec("cmd /c gpg --trust-model always --batch --yes --recipient mypgpkey --armor --output C:\\TextFolder\\EncryptFile.txt --encrypt C:\\TextFolder\\TextFile.txt")

In "resultObj" object we are getting ExitCode = 2 whether it should be 0.

Jyotish Singh
  • 2,065
  • 3
  • 20
  • 28
  • Are you running the application from a different user context than you imported it from? This is the usual issue, GnuPG has per system-user individual GnuPG home directories and key stores. – Jens Erat Sep 05 '15 at 14:57

0 Answers0