- Use, copy, rename or replace operating system files and folders.
- Enable or disable services or devices from starting when you next start your computer.
- Repair the file system boot sector or the Master Boot Record (MBR).
- Create and format partitions on drives.
Starting the Windows Recovery ConsoleTo start the Windows Recovery Console, use any of the following methods:
- Start your computer with the Windows Setup floppy disks, or with the Windows CD-ROM. At the "Welcome to Setup" screen, press F10, or press R to repair, and then press C (Windows 2000 only) to start the Windows Recovery Console. Select the appropriate number for the Windows installation that you want to repair, and then type the administrator password. If the administrator password does not exist, just press ENTER.
- Add the Windows Recovery Console to the Windows Startup folder by using Winnt32.exe with the /cmdcons switch. This procedure requires approximately 7 MB of hard disk space on your system partition to hold the Cmdcons folder and files.
NOTE: If you are using software mirroring, please see the following article in the Microsoft Knowledge Base:
229077 Mirroring Prevents Pre-Installing the Recovery Console
- Follow the instructions in the following article in the Microsoft Knowledge Base:
222478 Creating a Template to Run Recovery Console Using a Remote Install Server
Using the Command ConsoleAfter you start the Windows Recovery Console, you receive the following message:
This is a limited function command prompt intended only as a system recovery utility for advanced users. Using this utility incorrectly can cause serious system-wide problems that may require you to reinstall Windows to correct them.
Type 'exit' to leave the command prompt and reboot the system.
Which Windows installation would you like to logon to (enter to abort)?
Restrictions and Limitations of the Command ConsoleFrom the Windows Recovery Console you can only use the following folders:
- The root folder
- The %SystemRoot% folder and the subfolders of the Windows installation you are currently logged on to
- The Cmdcons folder
- Removable media drives such as CD-ROM drives
HELPUse the help command to list all of the following supported commands:
attrib delete fixboot md type
cd dir fixmbr mkdir systemroot
chdir disable format more
chkdsk diskpart help rd
cls enable listsvc ren
copy exit logon rename
del expand map rmdir
ATTRIBUse the attrib command with any of the following parameters to change attributes of a file or folder:
+ Sets an attribute.
- Resets an attribute.
R Read-Only file attribute.
S System file attribute.
H Hidden file attribute.
CD and CHDIRUse the cd and chdir commands to change the folder. If you type cd .., you specify that you want to change to the parent folder. Type cd drive: to display the current folder in the specified drive. Type cd without parameters to display the current drive and folder. The chdir command treats spaces as delimiters. Because of this, you must enclose a subfolder name that contains a space with quotation marks, for example:
The /p switch instructs CHKDSK to do an exhaustive check of the drive even if the drive is not marked with problems, and then corrects any errors that are found. The /r switch locates bad sectors and recovers readable information. Note that if you specify the /r switch, the /p switch is implied. The chkdsk command may be specified without arguments, in which case the current drive is implied with no switches. Optionally, the listed switches are accepted. The chkdsk command requires the Autochk.exe file. Chkdsk automatically locates this file in the bootup folder. Typically, this folder is the Cmdcons folder if the Command Console was pre-installed. If the folder cannot be found in the bootup folder, Chkdsk tries to locate the Windows CD-ROM installation media. If the installation media cannot be found, Chkdsk prompts you to provide the location of the Autochk.exe file.
CLSUse this command to clear the screen.
If destination is not specified, it defaults to the current folder. If the file already exists, you are prompted to overwrite it.
DEL and DELETE
command does not accept wild card (*) characters.
D - Directory R - Read-only file
H - Hidden file A - Files ready for archiving
S - System file C - Compressed
E - Encrypted P - Reparse Point
Use the listsvc command to display all eligible services or drivers to disable. The disable command prints the old start type of the service before resetting it to SERVICE_DISABLED. Because of this, you should record the old start type in case it is necessary to re-enable the service.
The start_type values that the disable command displays are:
- /add: Creates a new partition.
- /delete: Deletes an existing partition.
- device_name: The device name for creating a new partition. The name can be obtained from the output of the MAP command, for example: \Device\HardDisk0.
- drive_name: A drive-letter based name for deleting an existing partition, for example D:
- partition_name: The partition-based name for deleting an existing partition and can be used in place of the drive name argument, for example: \Device\HardDisk0\Partition1.
- size: The size of the new partition in megabytes.
WARNING: This command can damage your partition table if the disk has been upgraded to a dynamic disk configuration. Do not modify the structure of dynamic disks unless you are using the Disk Management tool.
ENABLEenable servicename start_type
You can use the enable command (where servicename is the name of the service or driver to be enabled) to enable a Windows system service or driver.
Use the listsvc command to display all eligible services or drivers to enable. The enable command prints the old start type of the service before resetting it to the new value. You should note the old value, in case it is necessary to restore the start type of the service.
Valid start_type are:
EXITUse the exit command to quit the Command Console and restart your computer.
NOTE: You may not include wildcards.
If destination is not specified, the command defaults to the current folder.
- /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 files to be expanded. You may include wildcards.
- /d: Do not expand; only display a directory of the files which are contained in the source.
expand prompts you if the destination file already exists unless you use /y.
WARNING: This command has the potential to damage your partition tables if a virus is present or a hardware problem exists. This command may lead to inaccessible partitions. Microsoft suggests running antivirus software before using this command.
The name can be obtained from the output of the map command. If this is left blank, the boot device's MBR is fixed, for example:
If a file system is not specified, the existing file system format is used, when available.
LISTSVCThe listsvc command lists all available services, drivers, and their start types for the current Windows installation. This command may be useful when using the disable and enable commands.
NOTE: These are extracted from the %SystemRoot%\System32\Config\SYSTEM hive. If the SYSTEM hive become damaged or missing, unpredictable results may occur.
MD and MKDIRThe md or mkdir commands create new folders. Wildcard characters are not supported. The mkdir command only operates within the system folders of the current installation of Windows, removable media, the root folder of any hard disk partition, or the local installation sources.
RD and RMDIRThe rd and rmdir commands delete a folder. These commands only operate within the system folders of the current Windows installation, removable media, the root folder of any hard disk partition, or the local installation sources.
REN and RENAMEThe ren and rename commands can rename a file. Note that you cannot specify a new drive or path for your destination file. These commands only operate within the system folders of the current Windows installation, removable media, the root folder of any hard disk partition, or the local installation sources.
SETThe set command allows you to display or modify four environment options.
SYSTEMROOTThe systemroot command sets the current working folder to the %SystemRoot% folder of the Windows installation you are currently logged on to.
Article ID: 229716 - Last Review: Dec 16, 2009 - Revision: 1