title: Decrypt file with Previous date file
body: <p>I receive .gpg files on daily basis with yesterdays date stamp (<strong>e.g my_daily_export_20170908.csv.gpg</strong>) I'm able to decrypt the file if I change the datestamp to <em>current date</em>, but not with yesterdays date, any thoughts please? My code as follows:</p>
  
  <pre><code>@echo off
  
  for /f "delims=" %%a in ('wmic OS Get localdatetime  ^| find "."') do set "dt=%%a"
  set "YYYY=%dt:~0,4%"
  set "MM=%dt:~4,2%"
  set "DD=%dt:~6,2%"
  set "HH=%dt:~8,2%"
  set "Min=%dt:~10,2%"
  set "Sec=%dt:~12,2%"
  set "secret=mypassphrase"
  set datestamp=%YYYY%%MM%%DD%
  
  set "origPath=Y:\"
  set "origFile=my_daily_export_"
  set "origExt=.csv.gpg"
  set "origCompleteFile=%origPath%%origFile%%datestamp%%origExt%"
  
  set "destPath=G:\"
  set "destFile=my_daily_export_"
  set "destExt=.csv"
  set "destCompleteFile=%destPath%%destFile%%datestamp%%destExt%"
  
  set "ctaFolder=S:\"
  
  echo Decrypt file: "%origCompleteFile%"
  echo Save decrypted file in: "%destCompleteFile%"
  
  rem Decrypt CTA file
  gpg --batch --passphrase "%secret%" -o "%destCompleteFile%" --decrypt "%origCompleteFile%"
  
  
  rem Copy to CTA folder in .54
  %SystemRoot%\System32\xcopy.exe "%destCompleteFile%" "%ctaFolder%" /Q /Y &gt;nul
  endlocal
  </code></pre>