|Batch script GPG encryption automation|
Really need help on the issue below:
I tried to create a bat file with command below and it is working fine..
But when I run it from a windows service, then it cannot work, no response at all..
The windows service is running as Local System Account with interact with desktop enabled.
PATH=C:\Program Files (x86)\GNU\GnuPG;%PATH%
>"%TMP%\~encryptlist.txt" DIR /B "C:\outgoingdropfolder"
FOR /F "delims=" %%F IN ('MORE ^< "%TMP%\~encryptlist.txt"') DO (
IF EXIST %%F (
ECHO password| GPG --batch -se --passphrase-fd 0 -r PGPTOKEY -o "C:\encryptedfiles\%%F.pgp" %%F
IF ERRORLEVEL == 0 DEL "%%F"