Solved

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

Posted on 2010-08-17
5
816 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 51

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 51

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

762 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

20 Experts available now in Live!

Get 1:1 Help Now