Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Paste
P13
(An Untitled Masterwork)
Active
Public
Actions
Authored by
•
aheinecke
on Jun 4 2021, 1:12 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Tags
None
Subscribers
None
@echo off
REM Set the GnuPG homedir here accordingly
set GPGHOME=c:\users\Andre Heinecke\AppData\Roaming\gnupg
REM Set the input / output directory
set INDIR=c:\input-files
set OUTDIR=c:\output-files
set INPUTEXT=.gpg
set OUTPUTEXT=
cd %INDIR%
mkdir %OUTDIR% 2>nul
for /R %%f in (*%INPUTEXT%) do (
setlocal enabledelayedexpansion
for %%i in ("%%f") do (
set filename=%%~ni
)
set OUTPATH=%OUTDIR%\!filename!%OUTPUTEXT%
echo Decrypting %%f into !OUTPATH! >> "%OUTDIR%\decrypt.log"
rem Overwrite handling?
gpg --verbose --homedir "%GPGHOME%" --yes --batch --log-file "%OUTDIR%\decrypt.log" -o "!OUTPATH!" -d -- "%%f"
if !ERRORLEVEL! NEQ 0 (
echo Operation failed with return code: %ERRORLEVEL% >> "%OUTDIR%\decrypt.log"
) else (
echo Operation finished successfully >> "%OUTDIR%\decrypt.log"
cd "%OUTDIR%"
tar -xf "!OUTPATH!"
if !ERRORLEVEL! NEQ 0 (
echo Extracting failed with return code: %ERRORLEVEL% >> "%OUTDIR%\decrypt.log"
) else (
echo Deleting %%f >> "%OUTDIR%\decrypt.log"
del "%%f" >> "%OUTDIR%\decrypt.log" 2>&1
rem echo Deleting !OUTPATH! >> "%OUTDIR%\decrypt.log"
del "!OUTPATH!" >> "%OUTDIR%\decrypt.log" 2>&1
)
)
)
Event Timeline
•
aheinecke
created this paste.
Jun 4 2021, 1:12 PM
2021-06-04 13:12:04 (UTC+2)
•
Fred23
archived this paste.
Jun 20 2021, 6:01 PM
2021-06-20 18:01:27 (UTC+2)
•
werner
activated this paste.
Jun 20 2021, 6:15 PM
2021-06-20 18:15:03 (UTC+2)
Log In to Comment