PGP - Encrypt and decrypt files through batch

  • Tim,

    I noticed your posting on fully qualifying a command prompt pgp call. I did try that but am getting an error message that I can't see to find an explanation for...I'm wondering if my syntax is correct...any thoughts?

    (I have additional parameters for the -decrypt but am wondering about the fully qualified command call??

    \\servername\PGPdirectory\pgp.exe --decrypt "\\servername\ftproot\staging\filename"

    error that I'm getting back is -1073741515

    Thanks,

    Pam

  • Pam,

    Off the top of my head, it looks like you're trying to run a remote PGP command. (based on you using \\servername\path\pgp.exe) In my experience, you likely need this installed and configured locally in order to get this to work. I can't speak to that specific error, but when we were using GnuPG (gpg.exe), we added it to the path and made sure that it could always find the keystore for the public/private keys that were needed. If you try to run the command on that machine, what happens? What happens when you run it as the service account?

    I'm not sure how the official PGP software stores its keys, but that could play into the issues as well if those keys are stored per user as opposed to just on the server.

  • Peter,

    Thanks for your prompt reply. Some of the research I did after this post indicates exactly what you are thinking. The command needs to run on the same server that PGP is installed on. I was trying to see if we could use a remote call; we are processing this from Tidal scheduling software and I recently learned that the Tidal agent has to be on the same server as the PGP install, so we will make changes to our setup and try this again.

    Pam

  • LOOKING AT THIS LINK IS AN EXAMPLE OF HOW TO DO IT, COULD TAKE THE CODE AS AN EXAMPLE AND PUBLISH DLL DLL AND THEN THAT APPEAR ON YOUR PROJECT

  • Hi Amy,

    Like you I've spent 2 days trying to resolve this issue, the batch file runs perfectly when clicked on but does not produce the desired result when called from the SQL Agent job. Just wondering how you resolved this in the end?

    Many thanks,

    Ali

  • Ali,

    You may want to verify the account used to run the job vs. the one you're using to run the batch file when it works. There could be a path issue there where your logged-in account has all of the necessary configurations and paths set properly but the service account doesn't. That would definitely cause issues. You may want to try piping the output of your batch to a text file when run as a job to see if you can catch more of the errors that way. I suspect that there's a setup or configuration issue when running as a job that would need to be resolved - either by logging in as the service account or some similar means.

Viewing 6 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic. Login to reply