[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


How to do a directory listing of ZIP files?

Posted on 2014-08-15
Medium Priority
Last Modified: 2014-09-23
I have been tasked with going through a client’s file shares and looking for file types with a specific extension.  I did this easily using the dir command.

I am now being asked to create a similar listing, but for items in ZIP files.  I am hoping to do something similar to the dir command with the /b switch.

I found the article below.  My only concern with it is the format of the output.  It will require a bit of work to make it similar to the dir command the /b switch.


I wanted to see if anyone had any suggestions on how to accomplish this task?
Thanks in advance.
Question by:rye004
LVL 14

Expert Comment

by:Brad Groux
ID: 40263761
This gentleman seems to have written a PowerShell script to do it - http://damashiuchi.wordpress.com/2011/02/19/get-child-items-in-a-zip-file-recursively-using-windows-powershell/

You can also use PowerShell for sorting and dumping files names to CSV or Text as needed as well.

Expert Comment

by:Sir Learnalot
ID: 40263775
cd to the directory where you would like to list the files and run the following command:

dir /b *.zip
LVL 97

Expert Comment

by:Lee W, MVP
ID: 40263943
Two things you can look at using - In Windows, look at the File Server Resource Manager - great tool for reporting on File Server usage and statistics.  Can generate reports too.

Or, you can run the command where X: is the drive you want to check:

DIR /S /B *.ZIP X:\ > X:\ZIPFiles.txt

The above command will search the ENTIRE DISK for ZIP files and report the full path (BUT NOT THEIR SIZE!) and save that information to a file in the root of the specified drive.

If you just want a sub folder, such as the "Users" sub folder, use:
DIR /S /B *.ZIP X:\Users > X:\Users\ZIPFiles.txt

Again, replace "X" with the drive letter you want.
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

LVL 14

Expert Comment

by:Justin Yeung
ID: 40264026
powershell =P
Get-ChildItem -path c:\ -Recurse | ? {$_.extension -eq ".zip"}

Open in new window


Accepted Solution

rye004 earned 0 total points
ID: 40284275
After some research, I found the following namespace in .net4.5 that was able to accomplish what I needed: System.IO.Compression;

Expert Comment

by:Sir Learnalot
ID: 40310621
Please close the issue by marking a solution. Have a great day

Author Closing Comment

ID: 40338604
This ended up being the best solution for me.

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When asking a question in a forum or creating documentation, screenshots are vital tools that can convey a lot more information and save you and your reader a lot of time
Know the reasons and solutions to move/import EDB to New Exchange Server. Also, find out how to recover an Exchange .edb file and to restore the file back.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question