WARNING: no command supplied after key change

Hello,
I have gpg4win installed installed on a windows server 2016 Datacenter for 3-4 years now and i created some scripts for encrypt/decrypt files.
All was working fine until recently when a pair of my keys are approaching the expiration date so i created a new pair in advance in order to share (the public key) with the other person whom i am exchanging the files.

So i modified the script that encrypts the files to use the new key and passphrase.
The command is the one below:
gpg --trust-model always --pinentry-mode=loopback --passphrase "passphrase" --local-user "newuser" --recipient "recipient" --armor --sign --output "pgpfile" --encrypt "sourcefile"

If i run this command from a command prompt the file is encrypted as expected.
However, when the script is executed it fails to encrypt the file.
It will display the warning “no command supplied. Trying to guess what you mean …” and it will just hang there.

It is strange how gpg command would execute without warning when running it from cli but complain about the syntax inside the script.
I am thinking if the passphrase is causing this behavior because it includes some special characters like $ and %.
This is the only difference that i can find comparing with the previous key but i wouldnt have the same issue when i run the command from cli as well?

Please advise.

HI @tuccero9,
if the used passphrase is the only difference you have found so far, then I suggest to try changing it.

The special characters you have mentioned may interfere with how the runner of the script (e.g. cmd.exe or something else) may actually call gpg, so gpg might see something else because of the special variable trigger some replacement.

Best Regards,
Bernhard

Hello Bernhard,

Thank you for your suggestion.
I changed the passphrase and i can encrypt the files from batch script as well.

The issue has been resolved.

Best Regards,

You are welcome, @tuccero9! Good to know you could resolve your issue!
Best Regards

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.