Guide to the Expand Command in Windows XP Recovery Console

Graphic image of computer code with bands of blue and purple color

Negative Space / Pexels / CC0

What Is the Expand Command?

The expand command is a Recovery Console command used to extract a single file or a group of files from a compressed file.

The expand command is typically used to replace damaged files in the operating system by extracting working copies of files from the original compressed files on the Windows XP or Windows 2000 CD.

An expand command is also available from the Command Prompt.

Expand Command Syntax

source — This is the location of the compressed file. For example, this would be the location of a file on the Windows CD.

/f:filespec — This is the name of the file that you want to extract from the source file. If the source only contains one file, this option isn't necessary.

destination — This is the directory where the source file(s) should be copied to.

/d — This option lists the files contained in the source but does not extract them.

/y This option will prevent the expand command from informing you if you are copying over files in this process.

Expand Command Examples

In the above example, a compressed version of the hal.dll file (hal.dl_) is extracted (as hal.dll) to the c:\windows\system32 directory.

The /y option prevents Windows from asking us if we would like to copy over the existing hal.dll file located in the c:\windows\system32 directory if there happens to be an existing copy there already.

In this example, all of the files contained in the compressed file are displayed on the screen. No files are actually extracted to the computer.

Expand Command Availability

The expand command is available from within the Recovery Console in Windows 2000 and Windows XP.

Expand Related Commands

The expand command is often used with many other Recovery Console commands.