You are not logged in.

#1 24 Oct 2015 17:35

thado77
Member
Registered: 02 Oct 2015
Posts: 8

Can anyone help (search a file in various zip files)

Hello everyone 

I need a code that  searches through a lot of zip files  a specific file that I will give from keyboard like e.g ( *code1*.txt)   and will appear the zip files that icludes the specific file.

Can anyone help me with that ????

Offline

#2 24 Oct 2015 20:47

npocmaka
Member
From: Bulgaria
Registered: 03 Dec 2009
Posts: 446

Re: Can anyone help (search a file in various zip files)

Take a look at zipjz.bat  - I think it's the most comprehensive script that uses Shell.Application zip capabilities  that can be found around (link).

To check if a zip file contains a certain file you can use:

call zipjs.bat list -source "C:\myZip.zip" -flat yes | findstr  /i /e "\code1.txt"

Offline

#3 25 Oct 2015 11:39

thado77
Member
Registered: 02 Oct 2015
Posts: 8

Re: Can anyone help (search a file in various zip files)

npocmaka thank you so much for your time and reply ,
I managed to insert the filename I want to search from keyboard but how can I make it search through a variety of zip files in the same directory ?
I tried call zipjs.bat list -source "C:\*.zip" -flat yes | findstr  /i /e "%fname%"  but i doesn't work sad

Offline

#4 25 Oct 2015 12:02

npocmaka
Member
From: Bulgaria
Registered: 03 Dec 2009
Posts: 446

Re: Can anyone help (search a file in various zip files)

thado77 wrote:

npocmaka thank you so much for your time and reply ,
I managed to insert the filename I want to search from keyboard but how can I make it search through a variety of zip files in the same directory ?
I tried call zipjs.bat list -source "C:\*.zip" -flat yes | findstr  /i /e "%fname%"  but i doesn't work sad


zipjs does not supports wild cards.
You rather need:

for /r "c:\rootDir" %%# in ("*.zip") do (
   call zipjs.bat list -source "%%#" -flat yes | findstr  /i /e "%fname%"
) 

Offline

#5 25 Oct 2015 13:15

thado77
Member
Registered: 02 Oct 2015
Posts: 8

Re: Can anyone help (search a file in various zip files)

Perfect !!!!

That worked perfectly !!!! Thanks again npocmaka !!!!  big_smile  big_smile  big_smile

Offline

Board footer

Powered by