Results 1 to 3 of 3

Thread: can you solve this problem???

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    112

    Question can you solve this problem???

    hi
    In VB6 there is a utility makecab.exe at
    C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard\makecab.exei copied this file and pasted into c:\windows\command
    and then i opened command (DOS) and type
    makecab and i got following

    C:\WINDOWS\Desktop\23>makecab
    Microsoft (R) Cabinet Maker - Version (32) 1.00.0600 (11/22/96)
    Copyright (c) Microsoft Corp 1993-1996. All rights reserved.

    MAKECAB [/V[n]] [/D var=value ...] [/L dir] source [destination]
    MAKECAB [/V[n]] [/D var=value ...] /F directive_file [...]

    source File to compress.
    destination File name to give compressed file. If omitted, the
    last character of the source file name is replaced
    with an underscore (_) and used as the destination.
    /F directives A file with MakeCAB directives (may be repeated).
    /D var=value Defines variable with specified value.
    /L dir Location to place destination (default is current directory).
    /V[n] Verbosity level (1..3).

    when i type: makecab test.txt test.cab
    i got following
    Microsoft (R) Cabinet Maker - Version (32) 1.00.0600 (11/22/96
    Copyright (c) Microsoft Corp 1993-1996. All rights reserved.
    100.00% - test.txt (1 of 1)

    and cab file (test.cab) created in current directory

    my question is that how can i make cab file compressing multiple files into a single
    cabinet (cab) file ,using makecab.
    Last edited by Nida; Mar 14th, 2006 at 03:15 PM.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    112

    Re: can you solve this problem???

    or if you know its uses in vb
    thanks

  3. #3
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: can you solve this problem???

    To put several files into the same cabinet file you have to create a "MakeCAB directives file". It's a pure text file containing directives and a list of files to be compressed. All directives starts with a dot (or period), for example:
    .Set CompressionType=MSZIP

    The file can also contain comments, a line with a comment starts with a semicolon. Comments are ignored by MakeCAB.exe. Here's an example of a Directives File:
    Code:
    ; Sample file... this is a comment BTW :-)
    .OPTION EXPLICIT 
    .Set CabinetNameTemplate=NameOfCabFile.cab
    .Set DiskDirectoryTemplate=CDROM ;This will put all files in the same CAB file (no span)
    .Set CompressionType=MSZIP
    .Set Cabinet=ON
    ;There are many more variables that you can set... But this is just a sample :-)
    ;*** After the directives you just list the files that should be added to the CAB ***
    MyFile.txt
    AnotherFile.doc
    ThatFile.xls
    ThisFile.vbs
    ;.... and so on... You can use relative path for the files, that is relative to where you
    ; place this file
    Now save that as a *.ddf file and use MakeCAB like this:
    MakeCAB.exe /f sampleFile.ddf

    For more info, download the Cabinet SDK from Microsoft. It includes some *.doc files and one of them explains everything about how to use MakeCAB.exe.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width