1.

Solve : How to answer "y" in a batch file?

Answer»

I'm writing a short BATCH file and drawing a BLANK. I'm going to encrypt a file with GnuPG but as I encrypt it, it'll ask me a question and it wants a yes or no answer. Is there a way I can code this in my batch file?Possibly. Use a pipe.

echo Y | GnuPG parametersNope, it didn't work.

Is there another way I can accomplish this with some other sort of script?

I want to run a COMMAND, and then I want the script to be able to answer yes and hit enter. I would like this all scripted.Didn't work how? If you are expected to respond "Yes" not "Y" to the prompt, simply pipe the word "Yes"

echo Yes | GnuPG parameters

Othwerwise, I found some howto's at:

HTTP://www.gnupg.org/(en)/documentation/howtos.html

Hope this helps. write y in for EXAMPLE file.txt.

GnuPG parameters
that should work.



Discussion

No Comment Found