title: Listing the contents of a ZIP file
body: <p>Following an example of tech-recipes I have managed to list the contents of a ZIP file (using 7-Zip:</p>
  
  <pre><code>FOR /F "tokens=* delims=" %%A in ('dir /b /s *.zip') do (7z.exe l -r "%%A" &gt;&gt; listing.txt)
  </code></pre>
  
  <p>However, this just dumps out the entire directory structure of the ZIP file into a text file (called listing.txt).</p>
  
  <p>I only want to list the directory names of the highest level directories e.g.</p>
  
  <p>Example.Zip </p>
  
  <pre><code>7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
  
  Listing archive: C:\Users\Test\Desktop\7zip\Demo.zip
  
  --
  Path = C:\Users\Test\Desktop\7zip\Demo.zip
  Type = zip
  Physical Size = 1252
  
     Date      Time    Attr         Size   Compressed  Name
  ------------------- ----- ------------ ------------  ------------------------
  2013-04-24 13:12:26 D....            0            0  Directory Three\Sub Folder One
  2013-04-24 13:13:00 D....            0            0  Directory Three\Sub Folder Three
  2013-04-24 13:12:54 D....            0            0  Directory Three\Sub Folder Two
  2013-04-24 13:12:26 D....            0            0  Directory Two\Sub Folder One
  2013-04-24 13:13:00 D....            0            0  Directory Two\Sub Folder Three
  2013-04-24 13:12:54 D....            0            0  Directory Two\Sub Folder Two
  2013-04-24 13:12:26 D....            0            0  Directory One\Sub Folder One
  2013-04-24 13:13:00 D....            0            0  Directory One\Sub Folder Three
  2013-04-24 13:12:54 D....            0            0  Directory One\Sub Folder Two
  ------------------- ----- ------------ ------------  ------------------------
                                       0            0  0 files, 9 folders
  </code></pre>
  
  <p>I would only want the text file to contain: </p>
  
  <ul>
  <li>Directory One</li>
  <li>Directory Two</li>
  <li>Directory Three</li>
  </ul>
  
  <p>Can anyone suggest how I could achieve this?</p>