GPG Command Options

I have a gpg command file (x.cmd) to encrypt a file that works fine when I run it from the command line, but it fails when I run it through the Windows task scheduler.

I have tried the command file with and without the --homedir with no luck on the pgp command line.

To troubleshoot I have added the --debug-level 8 and --log-file “d:\error.log” options as per the documentation.

With both options I get the “Note”:
gpg: Note: ‘–debug-level’ is not considered an option
gpg: Note: ‘–log-file’ is not considered an option

What am doing wrong? Is there a better way to troubleshoot this error?

Hi David,
so you already know about
which is good.

--debug-level works for me on the command line.
--log-file does not somehow (I’ve created to clear my confusion)

However gpg: Note: ‘–debug-level’ is not considered an option seems to mean that there is something else strange about how you call gpg. It may mean that those are not considered options because those arguments are transfered differently to the gpg binary.
How do you call it in particular?

Try using the options in a configuration file for debugging?
Otherwise try to redirect the output of your task scheduler run.


Got another hints:

For --log-file to work with gpg in 2.0.x and 2.2.x versions, please add --batch to the list of options.


Thanks for the tips adding the --batch and --log-file “xxx.log” right after the gpg command did the trick.

I still got an error because the system account did not have permissions. When I changed the task to run against my account (not a long term solution, but desperate times…), the task scheduler worked.

I will have to get with the system administrator to give the system account the appropriate permissions.

Thanks again,

good to know that things are working out for you!
(You may consider a support contract with us from,
if you have a company use case and want guaranteed response times.) :wink:

Note that we’ll add a hint that --batch is needed to the 2.2.x documentation.
Feel free to also suggest or do improvements to the wiki for others.

Best Regards,

how i get this working with windows 8 ? 64 bit.

Hi Jay,
what do you want to get working?
(Best is to start a new discussion thread, as David G.'s problem was solved in Nov 2019).

Best Regards,