title: Zip an epub using a batch file and 7zip
body: <p>I created this batch file to compress my epub files into an epub.</p>
  
  <p>It checks for an existing epub and deletes it.</p>
  
  <p>It checks the current folder name and then simply creates a zip file with the same name. 
  It then renames that .zip to a .epub</p>
  
  <pre><code>for %%a in (.) do set currentfolder=%%~na
  del *.epub
  7z a -tzip %currentfolder%.zip META-INF OPS mimetype
  rename *.zip *.epub
  </code></pre>
  
  <p>However I do not pass validation with this epub file. <a href="http://validator.idpf.org/" rel="nofollow">http://validator.idpf.org/</a> gives me the following two errors that I need to fix.</p>
  
  <ul>
  <li>Mimetype entry missing or not the first in archive</li>
  <li>item (OPS/image/Thumbs.db) exists in the zip file, but is not
  declared in the OPF file</li>
  </ul>
  
  <p>1.How do I force the mimetype file to be the first in the archive?</p>
  
  <p>2.How do I remove this thumbs.db, I can see it in the archive but i don't see it in Explorer?</p>
  
  <p>Thank you in advance</p>