title: Want to zip all the contents(files/folders) inside 4 different folders which are present inside a parent folder
body: <p>I want to zip all the contents, (folders/files), present inside <code>4</code> different folders, and want to keep the generated <code>4</code> different <code>.zip</code> files with the same name as their corresponding parent folder.</p>
  
  <p>For example, under location <code>D:\test\pk</code> I have <code>4</code> folders under <code>pk</code> folder:</p>
  
  <pre><code>knomBk-2.4-1
  knomBk-2.3-1
  knomBk-2.5-1
  knomBk-2.6-1
  </code></pre>
  
  <p>Inside all of these four folders I have a similar set of contents, (files/folders). I want to zip all the contents in all these four folders one by one and copy over the resultant <code>4</code> <code>.zip</code> files to a location on my <code>D:</code> drive.</p>
  
  <p>So I would be getting something like:</p>
  
  <pre><code>D:\outputzipfiles\knomBk-2.4-1.zip
  D:\outputzipfiles\knomBk-2.3-1.zip
  D:\outputzipfiles\knomBk-2.5-1.zip
  D:\outputzipfiles\knomBk-2.6-1.zip
  </code></pre>
  
  <p>How can I do it?  </p>
  
  <p>I have tried the <code>for %a in (directory) do {command..}</code> loop command like:</p>
  
  <pre><code> D:\test\pk&gt;  FOR %a in (`DIR \b  *-1`) do "C:\\Program Files\\7-Zip\\7z.exe" a -tzip d:/outputzipfiles/   -o"%~na"
  </code></pre>
  
  <p>I know the above command is wrong, as it must have be like something  -tzip d:\outputzipfiles\knomBk-*.zip, but I do not know how to do it.</p>
  
  <p>I also tried some combinations using the <code>forfiles</code> command but no success.</p>