title: dos batchfile to zip folders based on timespan
body: <p>I am looking for a way to zip folders based on a timespan of their lastmodified date and remove them afterwards</p>
  
  <p>the structure is as follows</p>
  
  <pre><code>Folder_1 01.01.2012 12:00
  - sub1
  - sub2
    - file1
    - file2
  Folder_2 01.01.2012 12:02
  ...
  Folder_20202 05.05.2012 03:00
  </code></pre>
  
  <p>I want now:</p>
  
  <ol>
  <li>to select all folders that are 3 months older than this month
  (e.g. lastmodified is february when current is may). An importand point is that I want to use 1st to last of month and not -90 days</li>
  <li>then zip the selected folders with all subfolders and files contained into one february2012.zip</li>
  <li>delete the originals of the (now) zipped files</li>
  </ol>
  
  <p>my best idea so far is to use forfiles.exe (which takes only one date), use a generated date (1st day of 3 month ago and use the older than modifier) and create a resultextfile. Then use the resultfile as import for 7zip.exe and somehow loop over the file and delete the folders afterwards (for part 2&amp;3, I have not yet a working code)</p>
  
  <p>-- UPDATE --</p>
  
  <p>At the moment I am experimenting with:</p>
  
  <pre><code>FORFILES /P H:\Temp\2zip /M O* /D -31.4.2012 /C "cmd /c C:\Program Files (x86)\7-Zip\7z.exe a -t7z H:\temp\x2.zip @path
  </code></pre>
  
  <p>which seems to work - but just very slowly (I guess reason is mapped drive -> 3h for 150MB)</p>