1

I am trying to decrypt multiple files to a different directory keeping the existing filenames. When i run the below syntax it seems to decrypt them ok but it only ouputs to the screen. I would like to either output the files with the same name to a different directory or overwrite the exciting files with the same name. Can this be done with gpg? Here is my syntax:

FOR %i in (C:\GPGFILES\*.gpg) do (gpg --batch --yes --passphrase key123 --decrypt "%i")
MadHatter
  • 79,770
  • 20
  • 184
  • 232
user3402451
  • 11
  • 1
  • 3

1 Answers1

2

You need the --output argument. If you don't tell it where to output the file, it will only print the output to the screen.

So:

FOR %i in (C:\GPGFILES\*.gpg) do (gpg --batch --yes --passphrase key123 --output "%i.txt" --decrypt "%i")
masegaloeh
  • 18,236
  • 10
  • 57
  • 106