Pages

Wednesday, May 5, 2010

"expand" Command

The Expand command is use to take a compressed Windows file and "expand" it to its original format. The expand command is an external command and is available in MS-DOS 6.0 and above, Windows 2000, Windows XP, Windows Vista and Windows 7.

Early Expand Command Syntax: Expands one or more compressed files:
  • EXPAND [-r] Source Destination
  • EXPAND -r Source [Destination]
Switches
  • -R - Automatically rename expanded files. Only valid for files compressed with -r switch.
  • Source - Source file specification. Source may be multiple file specifications. Wildcards may be used. 
  • Destination - Destination file / path specification. Destination may be a directory. If Source is multiple files and -r is not specified, Destination must be a directory. Wildcards may not be used.

Recent Expand Command Syntax: Expands one or more compressed files:
  • EXPAND [-r] Source Destination
  • EXPAND -r Source [Destination] 
  • EXPAND -D Source.cab [-F:Files] 
  • EXPAND Source.cab -F:Files Destination
Switches
  • -R - Rename expanded files.
  • -D - Display list of files in source. 
  • Source - Source file specification. WildCards (* and ?) may be used.
  • -F:Files - Name of files to expand from a .CAB. 
  • Destination - Destination file / path specification. Destination may be a directory. If Source is multiple files and -r is not specified, Destination must be a directory.
Recovery Console Expand Command Syntax: Expands a compressed file:
  • EXPAND source [/F:filespec] [destination] [/Y]
  • EXPAND source [/F:filespec] /D
Switches
  • Source - Specifies the file to be expanded. May not include WildCard (* and ?) characters.
  • Destination - Specifies the directory for the new file. The default is the current directory. 
  • /Y - Do not prompt before overwriting an existing file. 
  • /F:FileSpec - If the source contains more than one file, this parameter is required to identify the specific file(s) to be expanded. May include WildCards. 
  • /D - Do not expand; only display a directory of the files that are contained in the source.
The destination might be any directory within the system directories of the current Windows installation, the root of any drive, the local installation sources, or the CmdCons directory. The destination cannot be Removable Media. The destination file cannot be Read-Only. Use the Attrib command to remove the Read-Only attribute. Expand prompts if the destination file already exists unless /Y is used.

Repair Expand Command Syntax: Expands a compressed file:
  • EXPAND source [/F:filespec] [destination] [/Y]
  • EXPAND source [/F:filespec] /D
Switches
  • Source - Specifies the file to be expanded. May not include WildCards.
  • Destination - Specifies the directory for the new file. Default is the current directory. 
  • /Y - Do not prompt before overwriting an existing file. 
  • /F:FileSpec - If the source contains more than one file, this parameter is required to identify the specific file(s) to be expanded. May include WildCards.
  • /D - Do not expand; only display a directory of the files that are contained in the source.
The destination may be any directory within the system directories of the current Windows installation, the root of any drive, the local installation sources, or the CmdCons directory. The destination cannot be removable media. The destination file cannot be Read-Only. Use the Attrib command to remove the Read-Only attribute. EXPAND prompts if the destination file already exist unless /Y is used.

Examples
  • Expand d:\i386\hal.dl_ c:\windows\system32\hall.dll - Would expand the compressed version of the hall.dll file to the proper directory on the computer. All compressed files will end with a underscore. Therefore any windows file you're attempting to replace can be substituted in the above example.

No comments:

Post a Comment