Expand (Recovery Console)

How to Use the Expand Command in the Windows XP Recovery Console

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

expand source [/f:filespec] [destination] [/d] [/y]

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 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

expand d:\i386\hal.dl_ c:\windows\system32 /y

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.

expand /d d:\i386\driver.cab

In this example, all of the files contained in the compressed file driver.cab are displayed on 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.

More From Us