Solved

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

Posted on 2010-08-17
5
836 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 53

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 53

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

This is an explanation of a simple data model to help parse a JSON feed
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

777 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