Working with the Filesystem, Drives, Data, and Search - File Expansion Utility
(Page 3 of 4 )
\windows\system32\expand.exe
Extract one or more compressed files from a cabinet (.cab) file.
To open
Command Prompt -> expand
Usage
expand -d source.cab [-f:files]
expand [-r] source.cab [destination]
expand source.cab -f:files destination
Description
A cabinet file is a compressed archive commonly used to package application installation files. You use the File Expansion Utility to extract files embedded in these cabinet files. The utility takes the following options:
source.cab
The name of the cabinet (.cab) file from which to extract the files.
destination
The name of the folder in which to place the extracted files, a new filename to use for the extracted files, or a combination of the two. If using the -f option, destination is mandatory and must include a filename (with or without wildcards).
-d
Display (list) the contents of the specified cabinet file.
-r
Specify -r (recursive) without destination to extract all the files contained in the specified cabinet file. For example:
expand -r package.cab
Specify -r along with destination to rename the files according to the file specification included in destination . For example, the following extracts all the files in package.cab and renames their file extensions to .txt:
expand -r package.cab *.txt
-f:files
Use the -f option to specify one or more files to extract; use this if you don't want to extract all the files from the cabinet file. For example, the following extracts the file uno.txt from package.cab:
expand package.cab -f:uno.txt uno.txt
Note that the destination parameter is mandatory when using the -f option and is used to specify the target filename. In this example, as well as most times this program will be used, files and destination will be the same.
Notes
See also
"Cabinet (CAB) Maker," in Chapter 10
Next: File Properties >>
More BrainDump Articles
More By O'Reilly Media
|
This article is excerpted from chapter four of the book Windows Vista in a Nutshell, written by Preston Gralla (O'Reilly, 2006; ISBN: 0596527071). Check it out today at your favorite bookstore. Buy this book now.
|
|