Link to home
Start Free TrialLog in
Avatar of rye004
rye004Flag for United States of America

asked on

How to do a directory listing of ZIP files?

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.

http://www.tech-recipes.com/rx/9356/7-zip-how-to-list-contents-of-a-folder-and-subfolder-of-zip-files-without-extracting-win-xpvista7-and-command-line/

I wanted to see if anyone had any suggestions on how to accomplish this task?
Thanks in advance.
Avatar of Brad Groux
Brad Groux
Flag of United States of America image

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.
Avatar of Sir Learnalot
Sir Learnalot

cd to the directory where you would like to list the files and run the following command:

dir /b *.zip
Avatar of Lee W, MVP
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.
powershell =P
Get-ChildItem -path c:\ -Recurse | ? {$_.extension -eq ".zip"}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of rye004
rye004
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Please close the issue by marking a solution. Have a great day
Avatar of rye004

ASKER

This ended up being the best solution for me.