aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2025-07-24 12:25:33 +0000
committerWerner Koch <[email protected]>2025-07-24 12:25:33 +0000
commit197142f03bdefa26e40890c6490da0bb6014f96d (patch)
treee1f63aac192cd61c35e6714798482713c1880982
parentartwork: Add some icons from experiments (diff)
downloadgnupg-197142f03bdefa26e40890c6490da0bb6014f96d.tar.gz
gnupg-197142f03bdefa26e40890c6490da0bb6014f96d.zip
tools: Add an experimental Windows descryption script.
-- I am not sure whether this really works.
-rw-r--r--tools/decrypt.bat31
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/decrypt.bat b/tools/decrypt.bat
new file mode 100644
index 000000000..808689a11
--- /dev/null
+++ b/tools/decrypt.bat
@@ -0,0 +1,31 @@
+@echo on
+rem Decrypt all files in the input to the output directory.
+rem The input directory and the suffixes are defined by
+rem constants given below.
+
+rem Set the input/output directories and the suffixes.
+set INDIR=c:\input-files
+set OUTDIR=c:\output-files
+set INSUFFIX=.gpg
+set OUTSUFFIX=
+set LOGFILE=%APPDATA%\decrypt.log
+
+rem No serviceable parts below.
+
+set GPGARGS=--batch --yes --log-file "%LOGFILE%" --require-compliance
+cd %INDIR%
+mkdir %OUTDIR% 2>nul
+for /R %%f in (*%INSUFFIX%) do (
+ setlocal enabledelayedexpansion
+ for %%i in ("%%f") do (
+ set filename=%%~ni
+ )
+ set OUTPATH=%OUTDIR%\!filename!%OUTSUFFIX%
+ echo Decrypting %%f into !OUTPATH! >> "%LOGFILE%"
+ gpg %GPGARGS% -o "!OUTPATH!" -d -- "%%f"
+ if !errorlevel! neq 0 (
+ echo Operation failed with return code: %errorlevel% >> "%LOGFILE%"
+ ) else (
+ echo Operation finished successfully >> "%LOGFILE%"
+ )
+)