‎2007 Mar 07 7:47 PM
I'm trying to decrypt a .pgp file with GnuPG 1.4.6. I created a batch job with this command:
gpg --passphrase-fd 0 --decrypt-files *.pgp < {passphrase file}
When I execute the batch job through a Windows cmd line, it decrypts fine. When I call it through SM69, (with cmd /c {batch job file name}, the decryption fails.
It appears maybe the redirect changes the passphrase that is passing into gpg.
Does anyone have experience with this?
‎2007 Mar 07 7:55 PM
Yes, this will be definitely due to the redirection symbol <. Actually redirection directive is not passed to the command, but here SAP SM69 will try to pass it to the command which is wrong.
On the operating system, the shell will not allow the command, here gpg, to see redirection symbol <. So I would suggest you to encapsulate the command in a shell script and use the shell script name as a command in SM69. That will definitely solve your problem
‎2007 Mar 07 7:55 PM
Yes, this will be definitely due to the redirection symbol <. Actually redirection directive is not passed to the command, but here SAP SM69 will try to pass it to the command which is wrong.
On the operating system, the shell will not allow the command, here gpg, to see redirection symbol <. So I would suggest you to encapsulate the command in a shell script and use the shell script name as a command in SM69. That will definitely solve your problem
‎2007 Mar 07 8:41 PM
Sri Vishnu,
I think you are right about the redirection, but using the PATH variable to avoid cmd /c did not change the results. I've also tried to pipe the passphrase with an echo, and that too gets the same reaction.
‎2007 Mar 07 8:49 PM
Erik, I suppose you are using a batchfile name as your command and encapsulated the full pgp command inside that.
Given that info, are you using the full path name to the batchfile like say "C:\Program Files\Myexecutabl.bat" in the OS command field, in SM69?
You need to either provide full path to the batch file or put the batch file in a path present in the system PATH variable.
‎2007 Mar 07 9:15 PM
batch file name as my command, yes. pgp cmd inside it, yes.
I put the batch file in a PATH folder, but I also tried the former (full path in SM69), and neither solves.
‎2007 Mar 07 8:02 PM
Once again reading your query, I realize that you are using batch file on Windows. If that is the case, I would suggest you to put the batch file in some system accessible path (PATH variable) and directly use the <batch job name> without cmd /c
‎2007 Mar 08 11:08 PM
for posterity:
I figured this out. I created a scheduled task containing the batch file. The external command calls this scheduled task, and the pgp command runs as normal.