Listing content of .cab files

  • Thread starter Thread starter Roy Gunnarsson
  • Start date Start date
R

Roy Gunnarsson

Hello all,

We have a vendor who sends us hundreds of cab files each day. Each cab file
contains exactly one *randomly* named xml file which I want to extract, save
elsewhere under a different name, and parse. These tasks I can easily
accomplish *if* I know the name the xml file (not exactly correct - I can
extract the file to a directory of my choosing, but since I don't know the
name of the file, I have no way of moving, renaming, or parsing it according
to my needs (=my boss's wants). In other words, I would like to obtain a
string or an array containing the name(s) of the file(s) in the cab.

In VB6, I found a way (that can in no way be attributed to me) to do this
through a couple of API functions and callbacks. However, I was unsuccessful
to accomplish this in VB.NET. I'm still fairly new to .NET but it seems that
there should be some way to do this without too much pain.

Any help would be most appreciated.

Sincerely,

Roy Gunnarsson
 
Hi Roy,

The Api functions are still available through VB./NET but need to be
declared correctly.

If you wish to peek into the cabs yourself, the file format and example
code is available by typing CAB into the search box at
http://www.wotsit.org/search.asp

It's in C, which might dissuade you, but there are some comments which
would give you an idea.

Regards,
Fergus
 
* "Roy Gunnarsson said:
We have a vendor who sends us hundreds of cab files each day. Each cab file
contains exactly one *randomly* named xml file which I want to extract, save
elsewhere under a different name, and parse. These tasks I can easily
accomplish *if* I know the name the xml file (not exactly correct - I can
extract the file to a directory of my choosing, but since I don't know the
name of the file, I have no way of moving, renaming, or parsing it according
to my needs (=my boss's wants). In other words, I would like to obtain a
string or an array containing the name(s) of the file(s) in the cab.

No VB.NET solution, but maybe it points you in the right direction:

Q310618 Microsoft Cabinet Software Development Kit
<http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q310618>
 
Back
Top