Solved

Batch File: 7z.exe - DIR /s /b : Searching withing a ZIP file

Posted on 2010-08-17
5
827 Views
Last Modified: 2013-12-01
Hi there,

In Windows Explorer, when a right-click on a foler an performs a search command, the search will also be done in ZIP files.

I need to do the same by using a command line.

I tried dir /s /b ".\All my zip files\*my needed document*.xls without success.

Thanks,
Rene
0
Comment
Question by:ReneGe
  • 2
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
BasiKobrA earned 167 total points
ID: 33454687
Hi again,

If I am not mistaken, windows kind of unzips the zip files on-the-fly to be able to show you which files are in there or to let you search in them, however you can not just manipulate it like a directory as-is.

What exaclty do you want to do after the search ? With 7z you could '7z l yourArchive.7z' and, combined with the 'find' command' search for the specific string.
0
 
LVL 10

Author Comment

by:ReneGe
ID: 33456734
Makes sense.

Also knowing that Windows kind of Unzips the file to perform a search with in it, I then expect that I faile search within ZIP files will take ages.

I could also create an Index file, linking buth the files it containes and the ZIP file itself.

Lets see what others have to say about this.

Cheers,
Rene
0
 
LVL 52

Assisted Solution

by:Bill Prew
Bill Prew earned 333 total points
ID: 33460564
Not sure if I'm missing something, but using 7zip isn't this as simple as:


7z l file.zip "*my needed document*.xls"

or, if you need to search embedded folders in the zip:

7z l -r file.zip "*my needed document*.xls"

~bp
0
 
LVL 52

Assisted Solution

by:Bill Prew
Bill Prew earned 333 total points
ID: 33460569
And if you want to search many ZIPS, then something like this:

7z l *.zip "*my needed document*.xls"

~bp
0
 
LVL 10

Author Closing Comment

by:ReneGe
ID: 33461189
Thanks guys,
Rene
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

895 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

11 Experts available now in Live!

Get 1:1 Help Now