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

This 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 operating system’s CD.

Expand Command Availability

The expand command is available from the Command Prompt in modern versions of Windows, as well as from within the Recovery Console in Windows 2000 and XP.

Expand Command Syntax

Use the following syntax for the expand command:

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

The availability of certain expand command switches and other command syntax may differ from operating system to operating system. See How to Read Command Syntax if you’re not sure how to read the syntax above or in the table below.

Expand Command Examples

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

In this 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 system32 folder, if there happens to be an existing copy there already.

expand /d d:\i386\driver.cab

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

Get the Latest Tech News Delivered Every Day

  • How to Restore Hal.dll From the Windows XP CD

  • Rename Command

  • Copy Command

  • More Command

  • Net Send Command

  • What Is an EX_ File?

  • Xcopy Command

  • Vol Command Examples and Options

  • Net Command

  • Recovery Console: What It Is & a List of Commands

  • How to Use a RAR File Extractor for Android

  • Fixboot Command (Recovery Console)

  • How to Use the Netstat Command

  • What Are TGZ, GZ, & TAR.GZ Files?

  • Sfc Command (System File Checker)

  • Msg Command (Examples, Switches, and More)

  • Facebook

  • Twitter

Hit Refresh on Your Tech News

  • About Us

  • Privacy Policy

  • Editorial Guidelines

  • Terms of Use

  • Careers

  • Advertise

  • Contact

  • EU Privacy

  • NEWS

  • HOW TO

  • FEATURES

  • ABOUT US