How to do a directory listing of ZIP files?

Posted on 2014-08-15
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
    This gentleman seems to have written a PowerShell script to do it -

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

    Expert Comment

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

    dir /b *.zip
    LVL 95

    Expert Comment

    by: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.
    LVL 14

    Expert Comment

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

    Open in new window


    Accepted Solution

    After some research, I found the following namespace in .net4.5 that was able to accomplish what I needed: System.IO.Compression;
    LVL 5

    Expert Comment

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

    Author Closing Comment

    This ended up being the best solution for me.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    A quick step-by-step overview of installing and configuring Carbonite Server Backup.
    Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
    In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
    Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

    730 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now