GPG4Win Advice

Ian A Morris Ian.Morris at BimshireConsultancy.co.uk
Mon Jun 12 00:40:11 CEST 2017


Hi Peter,

Thank you very much for your email. It has answered a lot of the queries I had. Going forward, I think I may be able to wrap this all up in a PowerShell script to enable the removal of the original files and the required error checking. Most likely I will create a temp csv from the contents of the folder, process each file, check that there is an .txt and .asc of each file present and then move the .asc files to the required outbound folder and then move the unencrypted file to and archive on  separate fileserver. I can move forward with this because of your email. 

Many Thanks for your assistance!!!!

Kind Regards

Ian A Morris
IT Consultant
Bimshire Consultancy Ltd
Mobile   : +44 (0)7958 216696
Email       :  Ian.Morris at BimshireConsultancy.co.uk
Website : www.BimshireConsultancy.co.uk
 

-----Original Message-----
From: Peter Lebbing [mailto:peter at digitalbrains.com] 
Sent: 11 June 2017 20:53
To: Ian A Morris; gnupg-users at gnupg.org
Cc: Ian A Morris
Subject: Re: GPG4Win Advice

On 08/06/17 16:39, Ian A Morris wrote:
> When using the GUI there are options for the following, “Remove 
> unencrypted original file when don”

This is an extra convenience added by the GUI program. It is not in the command line interface.

> Gpg2 –batch –recipient /xxxxx / –encrypt-files –armor 
> C:\Location\*.txt

The simplest way is to follow this by
> del C:\Location\*.txt

but this introduces a race condition. So it's probably better to do something like

for x in C:\Location\*.txt
gpg2 ... --encrypt $x
del $x
next

However, it's been many years since I last did anything with MS-DOS/Windows batch files and I don't have the correct syntax ready. It needs to bail out when gpg2 errors, but that is way beyond my limited recollection of batch files.

Oh, and when building a gpg command line, you're supposed to put options before the command. However, it does try to cope with people putting options after the command. (And in the quote above, my e-mail client ended up putting an en-dash where there should be two ascii dashes, which kinda spoils the didactic value.) I'd suggest the following command line:

> gpg2 --batch --recipient XX --armour --encrypt-files C:\Location\*.txt

I see you're mailing from a .UK address, so I thought I could point out armour can be spelled with British spelling as well :-). --armor works just as well.

HTH,

Peter.

--
I use the GNU Privacy Guard (GnuPG) in combination with Enigmail.
You can send me encrypted mail if you want some privacy.
My key is available at <http://digitalbrains.com/2012/openpgp-key-peter>





More information about the Gnupg-users mailing list