Help keep getting error with gpg useing kleopatra

I run this command in batch was working put change to server and is now giving me the following error It works if a manually do it in kleopatra

 gpg --batch --yes --default-recipient client6 --output "E:\DA2_340B\Walgreens\%~i.pgp" --encrypt "E:\DA2_340B\Walgreens\%~i"

The error I get

gpg: unknown default recipient "client6"
gpg: E:\DA2_340B\Walgreens\1705_flatver4_delta_20250224061000.dat: encryption failed: No public key

Hi @gerand,
try to check what public key this call of gpg has access to, e.g. with:

gpg --list-keys client6
gpg --list-keys

When calling gpg from a batch process, it probably has a different GNUPGHOME directory. This FAQ entry may be related: https://wiki.gnupg.org/TroubleShooting#Windows_.3E_8_and_Server_2012_Task_Scheduler_Problems

Regards,
Bernhard

I just did a search on my c and E drive for GNUPGHOME and do not find it.
I also did
gpg --list-keys client6
Get - gpg: error reading key: No public key

gpg --list-keys
And get nothing

Do u think if from Kleopatra I delete my client6 cerificates and import it again it would correct and make keys.

Do u think if from Kleopatra I delete my client6 cerificates and import it again it would correct and make keys.

No.

If gpg --list-key does not list any, it is possible that you are using two versions of gpg with different GNUHOMEs. GNUHOME is just a name of an environment variable you can set to override other ways to set the home directory of gpg.

Try gpg --version and see which Home: it displays. However kleopatra should use the same.

I just try gpg --version and got the following
C:>gpg --version
gpg (GnuPG) 2.2.41
libgcrypt 1.10.2-unknown
Copyright (C) 2022 g10 Code GmbH
License GNU GPL-3.0-or-later https://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /home/cerner_sftp/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

Now what should a do.
Thanks again for the help

I just took a look at C: and I do not C:/
home/cerner_sftp/.gnupg
But I do see C:\CMS1\home\cerner_sftp.gnupg
and it has pubring.kbx in it.

But I do see C:\CMS1\home\cerner_sftp.gnupg

Read the FAQ entry Bernhard linked to.
Seems to me you need to use the --homedir option.

Thanks for all the help