Article ID: 314058 - View products that this article applies to.
This article was previously published under Q314058
For a Microsoft Windows 2000 version of this article, see 229716
Important noteThis is an advanced-level reference article that describes what the Recovery Console is and how to use it. It does not contain information about how to troubleshoot specific problems.
To use the Recovery Console, you will need a Windows installation disc.
You must be logged on as an administrator or a member of the Administrators group in order to run the computer in Recovery Console. If your computer is connected to a network, network policy settings may prevent you from completing this procedure. If you encounter this problem, you should contact the network administrator.
This article describes the functionality and limitations of the Windows Recovery Console. If a Windows XP-based computer does not start correctly or if it does not start at all, you may be able to use the Windows Recovery Console to help you recover the system software. This article discusses the following topics:
When you use the Windows Recovery Console, you can obtain limited access to the NTFS file system, FAT, and FAT32 volumes without starting the Windows graphical user interface (GUI). In the Windows Recovery Console, you can perform the following actions:
Option 1: If you have already installed the Recovery ConsoleIf you have already installed the Recovery Console, you can select it during your usual Windows Startup. To run the Recovery Console:
Option 2: Starting the Windows Recovery Console from the Windows XP CD-ROMIf you have not preinstalled the Windows Recovery Console, you can start the computer and use the Recovery Console directly from your original Windows XP installation disc. If your computer is already in Windows and you want to add the Windows Recovery Console as a startup option, go to the next section "Adding the Windows Recovery Console as a startup option."
Option 3: Adding the Windows Recovery Console as a startup optionIf your computer starts Windows, you can add the Windows XP Recovery Console as a startup option from the Windows environment. To install the Recovery Console as a startup option, follow these steps:
(https://support.microsoft.com/kb/229077/ )Mirroring prevents pre-installing the Recovery Console
Restrictions and limitations of the Recovery ConsoleWhen you use the Windows Recovery Console, you can use only the following items:
Using the Command Console within Windows Recovery ConsoleThe Recovery Console gives you limited access to the NTFS file system, FAT, and FAT32 volumes. Recovery Console prevents the familiar Windows Graphical User Interface (GUI) from loading in order to repair and recover Windows functionality.
After you start the Windows Recovery Console, you receive the following message: Enter the number for the appropriate Windows installation. In this example, you would press 1. Then, Windows prompts you to enter the Administrator account password.
Note If you use an incorrect password three times, the Windows Recovery Console closes. Also, if the Security Accounts Manager (SAM) database is missing or damaged, you cannot use the Windows Recovery Console because you cannot be authenticated correctly. After you enter your password and the Windows Recovery Console starts, type Exit to restart the computer.
When you use Windows XP Professional, you can set group policies to enable automatic administrative logon. For more information about how to set Recovery Console to enable automatic administrative logon, click the following article number to view the article in the Microsoft Knowledge Base:
(https://support.microsoft.com/kb/312149/ )How to enable an administrator to log on automatically in Recovery Console
Available commands within Windows Recovery ConsoleThe following commands are available within the Windows Recovery Console. The commands are not case-sensitive.
Warning Some of these commands can make your system inoperable. Read the whole explanation of any command before you enter it onto the command line. Seek the advice of a support professional if you have any questions or concerns about a particular command.
HELPUse the help command to list all the following supported commands:
attrib del fixboot more set batch delete fixmbr mkdir systemroot bootcfg dir format more type cd disable help net chdir diskpart listsvc rd chkdsk enable logon ren cls exit map rename copy expand md rmdir
ATTRIBUse the attrib command together with one or more of the following parameters to change the attributes of a file or a folder:
+ Sets an attribute
- Resets an attribute
R Read-only file attribute
S System file attribute
H Hidden file attribute
C Compressed file attribute
You must set or clear at least one attribute.
To view attributes, use the dir command.
batch inputfile [outputfile]Use this command to run commands that are specified in a text file. In the command syntax, inputfile specifies the text file that contains the list of commands to be run, and outputfile specifies the file that contains the output of the specified commands. If you do not specify an output file, the output appears on the screen.
BOOTCFGUse this command for boot configuration and recovery. This command has the following options:
bootcfg /redirect [portbaudrate] | [useBiosSettings]
bootcfg /redirect com1 115200
bootcfg /redirect useBiosSettingsYou can use the following options:
/add Adds a Windows installation to the boot menu list.
/rebuild Iterates through all Windows installations so that you can specify which installations to add.
/scan Scans all disks for Windows installations and displays the results so that you can specify which installations to add.
/default Sets the default boot entry.
/list Lists the entries already in the boot menu list.
/disableredirect Disables redirection in the boot loader.
/redirect Enables redirection in the boot loader, with the specified configuration.
CD and CHDIRUse the cd and chdir commands to change to a different folder. For example, you can use the following commands:
Type cd .. to change to the parent folder.The chdir command treats spaces as delimiters. Because of this, you must put quotation marks ("") around a folder name that contains a space.The following is an example:
Type cd drive: to display the current folder in the specified drive.
Type cd without parameters to display the current drive and folder.
cd "\windows\profiles\username\programs\start menu"The chdir command works only in the system folders of the current installation of Windows, in removable media, in the root folder of any hard disk partition, or in the local installation sources.
chkdsk drive /p /rThe chkdsk command checks the specified drive and repairs or recovers the drive if the drive requires it. The command also marks any bad sectors and it recovers readable information.
You can use the following options:
/p Does an exhaustive check of the drive and corrects any errors.Note If you specify the /r option, the /p option is implied. When you specify the chkdsk command without arguments, the command checks the current drive with no options in effect.
/r Locates bad sectors and recovers readable information.
When you run the chkdsk command, you must use the Autochk.exe file. CHKDSK automatically locates this file in the startup folder. If the Command Console was preinstalled, the startup folder is typically the Cmdcons folder. If CHKDSK cannot find Autochk.exe in the startup folder, CHKDSK tries to locate the Windows installation disc. If it cannot find the installation media, CHKDSK prompts you for the location of the Autochk.exe file.
CLSUse this command to clear the screen.
copy source destinationUse this command to copy a file. In the command syntax, source specifies the file to copy and destination specifies the folder or file name for the new file. You cannot use wildcard characters indicated by an asterisk (*), and you cannot copy a folder. If you copy a compressed file from the Windows installation disc, the file is automatically decompressed while it is copied.
The source of the file can be removable media, any folder in the system folders of the current Windows installation, the root of any drive, the local installation sources, or the Cmdcons folder.
If destination is unspecified, the default destination is the current folder. If the file already exists, you are prompted whether you want the copied file to overwrite the existing file. The destination cannot be removable media.
DEL and DELETE
del drive: path filename
delete drive: path filenameUse this command to delete a file. In the command syntax, drive: path filename specifies the file that you want to delete. The delete command works only in the system folders of the current Windows installation, in removable media, in the root folder of any hard disk partition, or in the local installation sources. The delete command does not accept wildcard characters.
dir drive: path filenameUse this command to display a list of files and subfolders in a folder. In the command syntax, drive: path filename specifies the drive, folder, and files to list. The dir command lists all files, including hidden files and system files. Files can have the following attributes:
D DirectoryThe dir command works only in the system folders of the current Windows installation, in removable media, in the root folder of any hard disk partition, or in the local installation sources.
H Hidden file
S System file
R Read-only file
A Files ready for archiving
P Reparse point
disable servicenameUse this command to disable a Windows system service or a driver. In the command syntax, servicename specifies the name of the service or driver that you want to disable.
Use the listsvc command to display all services or drivers that are eligible to be disabled. The disable command prints the old start type of the service before resetting the start type to SERVICE_DISABLED. Record the old start type if you must enable the service again.
The disable command displays the following start_type values:
diskpart /add/deletedevice_name drive_name partition_name sizeUse this command to manage the partitions on your hard disk volumes. You can use the following options:
/add Creates a new partition.You can determine the device name from the output of the MAP command, for example, \Device\HardDisk0. You can use the partition name instead of the drive name argument, for example, \Device\HardDisk0\Partition1. If you use no arguments, a user interface for managing your partitions appears.
/delete Deletes an existing partition.
device_name The name of the device that is used to create a new partition.
drive_name A drive-letter-based name, for example D:.
partition_name The partition-based name for deleting an existing partition.
size The size of the new partition in megabytes.
Warning If you use this command on a disk that has a dynamic disk configuration, you may damage the partition table. Do not modify the structure of dynamic disks unless you are using the Disk Management tool.
enable servicename start_typeYou can use the enable command to enable a Windows system service or a 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 it is reset to the new value. It is a good idea to note the old value, in case you have to restore the start type of the service.
Valid options for start_type are as follows:
SERVICE_BOOT_STARTIf you do not specify a new start type, the enable command prints the old start type for you.
EXITUse the exit command to exit the Recovery Console and restart your computer.
expand source [/F:filespec] [destination] [/y]
expand source [/F:filespec] /DUse this command to expand a file. In the command syntax, source specifies the name of the file to be expanded and destination specifies the folder for the new file. If you do not specify a destination, the command uses the current folder by default. You cannot include wildcard characters.
You can use the following options:
/y Do not prompt before overwriting an existing file.If the source contains more than one file, you must use the /f:filespec parameter to find the specific files to be expanded. You can include wildcard characters.
/f:filespec Identifies the files to be expanded.
/d Do not expand; display only a directory of the files in the source.
The destination can be any folder in the system folders of the current Windows installation, in the root of the drive, in the local installation sources, or in the Cmdcons folder. The destination cannot be removable media, and the destination file cannot be read-only. Use the attrib command to remove the read-only attribute.
Unless you use the /y option, the expand command prompts you if the destination file already exists.
fixboot drive name:Use this command to write the new Windows boot sector code on the system partition. In the command syntax, drive name is the drive letter where the boot sector will be written. This command fixes damage in the Windows boot sector. This command overrides the default setting, which writes to the system boot partition. The fixboot command is supported only on x86-based computers.
fixmbr device nameUse this command to repair the MBR of the boot partition. In the command syntax, device name is an optional device name that specifies the device that requires a new MBR. Use this command if a virus has damaged the MBR and Windows cannot start.
Warning This command can damage your partition tables if a virus is present or if a hardware problem exists. If you use this command, you may create inaccessible partitions. We recommend that you run antivirus software before you use this command.
You can obtain the device name from the output of the map command. If you do not specify a device name, the MBR of the boot device is repaired, for example:
fixmbr \device\harddisk2If the fixmbr command detects an invalid or non-standard partition table signature, fixmbr command prompts you for permission before it rewrites the MBR. The fixmbr command is supported only on x86-based computers.
format drive: /Q /FS:file-systemUse this command to format the specified drive to the specified file system. In the command syntax, /Q performs a quick format of the drive, drive is the drive letter of the partition to format, and /FS:file-system specifies the type of file system to use such as FAT, FAT32, or NTFS. If you do not specify a file system, the existing file system format is used if it is available.
LISTSVCThe listsvc command lists all available services, drivers, and their start types for the current Windows installation. This command is useful together with the disable and enable commands.
The list is extracted from the %SystemRoot%\System32\Config\System hive. If the System hive is damaged or missing, the results are unpredictable.
logonThe logon command lists all detected installations of Windows and then requests the local administrator password for the copy of Windows that you want to log on to. If your first three tries to log on fail, the console closes, and your computer restarts.
map arcUse this command to list drive letters, file system types, partition sizes, and mappings to physical devices. In the command syntax, the arc parameter tells the map command to use ARC paths instead of Windows Device paths.
MD and MKDIRThe md and mkdir commands create new folders. Wildcard characters are not supported. The mkdir command works only in the system folders of the current installation of Windows, in removable media, in the root folder of any hard disk partition, or in the local installation sources.
more filenameUse this command to display a text file to the screen.
NETAlthough the Help file states otherwise, the net command is not usable from the Recovery Console. The protocols stack is not loaded for the Recovery Console. Therefore, there is no networking function available.
RD and RMDIRUse rd and rmdir commands to delete a folder. These commands work only in the system folders of the current Windows installation, in removable media, in the root folder of any hard disk partition, or in the local installation sources.
REN and RENAMEUse the ren and rename commands to rename a file.
Note You cannot specify a new drive or path for the renamed file. These commands work only in the system folders of the current Windows installation, in removable media, in the root folder of any hard disk partition, or in the local installation sources.
SETYou can use the set to display or modify four environment options.
AllowWildCards = FALSE AllowAllPaths = FALSE AllowRemovableMedia = FALSE NoCopyPrompt = FALSEFor more information about how to use the set command, click the following article number to view the article in the Microsoft Knowledge Base:
(https://support.microsoft.com/kb/235364/ )Description of the SET command in Recovery Console
SYSTEMROOTThe systemroot command sets the current working folder to the %SystemRoot% folder of the Windows installation that you are currently logged on to.
type filenameUse the type command to display a text file.
For a Microsoft Windows 2000 version of this article, see 229716
For more information about the Recovery Console, visit the following Microsoft Web site:
Article ID: 314058 - Last Review: July 11, 2013 - Revision: 8.0