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.