title: Batch scripting GPG decryption
body: <p>I'm trying to write a Batch file to decrypt a folder of <code>.gpg</code> files that have all been encrypted with the same public key. This is what I have so far: </p>
  
  <pre><code>@ECHO off
  SET outbound=C:\encrypted files
  SET olddir=%CD%
  SET password=correcthorsebatterystaple
  CD /d %outbound%
  DIR *.gpg /B &gt; tmp.txt
  FOR /F "tokens=*" %%F IN (tmp.txt) DO (
      ECHO %%F &gt; tmplen.txt
      FOR %%L IN (tmplen.txt) DO (SET namelen=%%~zL)
      DEL tmplen.txt
      gpg --output %%F:~0, namelen-4 --batch --yes --passphrase %password% --decrypt %%F)
  DEL tmp.txt
  CD /d %olddir% 
  </code></pre>
  
  <p>Currently it just prints </p>
  
  <pre><code>usage: gpg [options] [filename]
  </code></pre>
  
  <p>This is my first time trying to write a Batch script, so I'm sure it's something simple.</p>