Microsoft KB Archive/318752

= HOW TO: Install and Use the Recovery Console in Windows 2000 =

PSS ID Number: 318752

Article Last Modified on 2/13/2004

-

The information in this article applies to:


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional

-



This article was previously published under Q318752



IN THIS TASK

 * SUMMARY
 * ** How to Install the Recovery Console
 * How to Use the Recovery Console
 * *** How to Use the Recovery Console from the Boot Menu
 * How to Use the Recovery Console from the Windows 2000 Startup Disks or the Windows 2000 CD-ROM
 * How to Use the Recovery Console Command Prompt
 * Command Actions
 * Recovery Console Rules
 * How to Delete the Recovery Console
 * How to Install Recovery Console During an Unattended Install
 * REFERENCES



SUMMARY
You can use the Windows Recovery Console to help recover a Windows-based computer that either does not start properly or does not start at all. If Safe mode and other startup options do not work, you may want to use the Recovery Console. This method is recommended only if you are an advanced user who can use basic commands to identify and locate problem drivers and files. In addition, you must be an administrator to use the Recovery Console.

back to the top

How to Install the Recovery Console
You can install the Recovery Console on your computer to make it available if you are unable to restart Windows. After you install the Recovery Console, the Recovery Console is displayed on the list of available operating systems when you start the computer. It is recommended that you install the Recovery Console on important servers and on the workstations of technology personnel. To install the Recovery Console, you must have administrative rights on the computer.

Although you can run the Recovery Console by starting directly from the Windows 2000 CD, it is more convenient to set up the Recovery Console as a Startup option on your boot menu. To run the Recovery Console directly by starting from the CD, see the How to Use the Recovery Console section later in this article.

To install the Recovery Console:
 * 1) Insert the Windows 2000 CD into the CD-ROM drive.
 * 2) Click Start, and then click Run.
 * 3) In the Open box, type  :\i386\winnt32.exe /cmdcons, where   is the drive letter for the CD-ROM drive.
 * 4) Click Yes to start the installation procedure.
 * 5) Restart the computer. The next time you start your computer, &quot;Microsoft Windows Recovery Console&quot; is displayed on the boot menu.

NOTE: Alternatively, you can use a Universal Naming Convention (UNC) name to install the Recovery Console from a network share point.

back to the top

How to Use the Recovery Console
You can use the Recovery Console to enable and disable services, format drives, read and write data on a local drive (including drives that are formatted to use the NTFS file system), and perform many other administrative tasks. You can use the Recovery Console to either repair your computer by copying a file from a disk or CD-ROM to your hard disk or to reconfigure a service that is preventing your computer from starting properly.

back to the top

How to Use the Recovery Console from the Boot Menu
If you have installed the Recovery Console on your computer to make it available if you are unable to restart Windows, you can select the Recovery Console from the list of available operating systems that is displayed when you start your computer.

To run the Recovery Console from the Windows 2000 boot menu.

NOTE: This procedure assumes that you have completed the procedure that is described in the Installing the Recovery Console section of this article.
 * 1) Start the computer, and then select Microsoft Windows Recovery Console on the boot menu.
 * 2) If you have a dual-boot or multiple-boot computer, choose the installation that you want to access from the Recovery Console.
 * 3) Type the administrator password. If the administrator password is blank, press ENTER.
 * 4) At the command prompt, type the appropriate commands to diagnose and repair your Windows 2000 installation.

For a list of commands that are available in Recovery Console, type recovery console commands or help at the command prompt, and then press ENTER.

For information about a specific command, type help at the command prompt, and then press ENTER.
 * 1) To exit the Recovery Console and restart the computer, type exit at the command prompt, and then press ENTER.

back to the top

How to Use the Recovery Console from the Windows 2000 Startup Disks or the Windows 2000 CD-ROM
If you cannot start your computer, you can run the Recovery Console from either the Windows 2000 startup disks or the Windows 2000 CD-ROM. To run the Recovery Console from the Windows 2000 startup disks or the Windows 2000 CD-ROM:
 * 1) Either insert the Windows 2000 startup disk into the floppy disk drive or insert the Windows 2000 CD-ROM into the CD-ROM drive, and then restart the computer.
 * 2) Click to select any options that are required to start the computer from the CD-ROM drive if you are prompted to do so.
 * 3) At the Setup screen, press R to repair the installation, and then press C to start Recovery Console.
 * 4) If you have a dual-boot or multiple-boot computer, choose the installation that you want to access from the Recovery Console.
 * 5) Type the administrator password.

If the administrator password is blank, press ENTER.
 * 1) At the command prompt, type the appropriate commands to diagnose and repair your Windows 2000 installation.

For a list of commands that are available in Recovery Console, type either recovery console commands or help at the command prompt, and then press ENTER.

For information about a specific command, type help at the command prompt, and then press ENTER.
 * 1) To exit the Recovery Console and restart the computer, type exit at the command prompt, and then press ENTER.

For additional information about how to create startup disks for Windows 2000, click the article number below to view the article in the Microsoft Knowledge Base:

197063 How to Create Setup Boot Disks for Windows 2000

NOTE: To start the computer from the Windows 2000 CD-ROM, you need to configure the basic input/output system (BIOS) of the computer to start from your CD-ROM drive.

back to the top

How to Use the Recovery Console Command Prompt
When you use the Recovery Console, you are working at a special command prompt instead of the usual Windows command prompt. The Recovery Console has its own command interpreter. When you enter this command interpreter, the Recovery Console prompts you to type the administrator password (the local administrator password, not a domain administrator password).

NOTE: If the computer is a Domain Controller that is using Active Directory, use the password that was chosen as the &quot;Directory Services Restore Mode&quot; password when the server was promoted to a domain controller.

After the Recovery Console starts, you can press F6 to install a third-party SCSI or RAID driver (if you need such a driver to access the hard disk). This prompt works the same as it does during installation of the operating system.

The Recovery Console takes a few seconds to start. When the Recovery Console menu is displayed, a numbered list of the Windows installations on the computer is displayed. Press a number before you press ENTER, even when only one entry is displayed. If you press ENTER without pressing a number, the computer restarts and begins the process again.

After you see the prompt for %SystemRoot% (usually C:\Windows), you can start to use the available commands for the Recovery Console.

back to the top

Command Actions
The following list describes the available commands for the Recovery Console:

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

ATTRIB
Use the attrib command with any of the following parameters to change attributes of a file or folder:
 * -r: Sets a read-Only file attribute
 * +r: Resets a read-Only file attribute
 * -s: Sets a system file attribute
 * +s: Resets a system file attribute
 * -h: Sets a hidden file attribute
 * +h: Resets a hidden file attribute

NOTE: At least one attribute must be set or cleared. To view attributes, use the dir command.

BATCH
batch  [ ]

Use this command to run commands that are specified in a text file. In the command syntax,  specifies the text file that contains the list of commands to be run and   specifies the file that contains the output of the specified commands. If you do not specify an output file, the output is displayed on the screen.

CD and CHDIR
Use the cd and the chdir commands to change the folder. Type cd .. to 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. Therefore, you must enclose a subfolder name that contains a space with quotation marks, for example:

cd &quot;\winnt\profiles\username\programs\start menu&quot;

The chdir 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.

CHKDSK
chkdsk  /p /r

This command (where  specifies the drive to check) checks the drive, and if needed, repairs or recovers the drive. It also marks bad sectors and recovers readable information.

The /p switch instructs the Chkdsk tool 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 Startup folder. Typically, this folder is the Cmdcons folder if the Command console was pre-installed. If the folder cannot be found in the Startup 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.

CLS
Use this command to clear the screen.

COPY
copy  

Use this command (where  specifies the file to be copied and   specifies the folder or file name for the new file) to copy a file. Wildcards or folder copies are not permitted. A compressed file from the Windows CD-ROM is automatically decompressed as it is copied.

If you do not specify, the command defaults to the current folder. If the file already exists, you are prompted to overwrite it.

DEL and DELETE
del :   

delete :   

Use this command (where :    specifies the file to delete) to delete a file.

The delete command only operates within the system folders of the current Windows installation, removable media, the root folder of any hard disk partition, or the local installation sources. The delete command does not accept wildcard (*) characters.

DIR
dir :   

Use this command (where :    specifies drive, folder, and files to list) to display a list of files and subfolders in a folder. The dir command lists all files including hidden and system files. Files may have the following attributes:

D - Directory      R - Read-only file H - Hidden file    A - Files ready for archiving S - System file    C - Compressed E - Encrypted      P - Reparse Point

The dir command only operates within the system folders of the current Windows installation, removable media, the root folder of any hard disk partition, or the local installation sources.

DISABLE
disable 

Use this command (where  specifies the name of the service or driver to be disabled) to disable a Windows system service or driver.

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.

Use the disable command to display the following start_type values:

SERVICE_DISABLED

SERVICE_BOOT_START

SERVICE_SYSTEM_START

SERVICE_AUTO_START

SERVICE_DEMAND_START

DISKPART
diskpart      

Use this command to manage the partitions on your hard disk volumes.
 * /add: Use this parameter to create a new partition.
 * /delete: Use this parameter to delete an existing partition.
 *  : Use this parameter to specify the device name that you want to use to create a new partition. The name can be obtained from the output of the map command, for example: \Device\HardDisk0.
 *  : Use this parameter to specify a drive letter-based name that you want to use to delete an existing partition, for example D:
 *  : Use this parameter to specify the partition-based name that you want to use to delete an existing partition. You can use this parameter in place of the drive name argument, for example: \Device\HardDisk0\Partition1.
 *  : Use this parameter to specify the size of the new partition in megabytes (MB).

NOTE: If no arguments are used, a user interface that you can use to manage your partitions is displayed.

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.

ENABLE
enable  

You can use the enable command (where  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. The following start types are valid:

SERVICE_BOOT_START

SERVICE_SYSTEM_START

SERVICE_AUTO_START

SERVICE_DEMAND_START

NOTE: If you do not specify a new start type, the enable command prints the old start type for you.

EXIT
Use the exit command to quit the Command console and restart your computer.

EXPAND
expand  [/F:filespec] [destination] [/y]

expand source [/f: ] /d

Use this command (where  specifies the name of the file to be expanded and   specifies the folder for the new file) to expand a file.

NOTE: You cannot include wildcards.

If  is not specified, the command defaults to the current folder.

You can use this command with the following parameters:
 * /y: Use this parameter if you do not want to be prompted before an existing file is overwritten.
 * /f: : Use this parameter 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: Use this parameter if do not want the folder to be expanded; it only displays a folder of the files which are contained in the source.

The destination may be any folder within the system folders of the current Windows installation, the root of the drive, the local installation sources, or the Cmdcons folder. The destination cannot be removable media. The destination file cannot be read-only. Use the attrib command to remove the read-only attribute.

If you use the expand command, you are prompted if the destination file already exists unless you use /y.

FIXBOOT
fixboot :

Use this command (where  is the drive letter where the boot sector will be written) to write the new Windows boot sector code on the boot partition. This command fixes problems where the Windows boot sector is corrupted. The Emergency Repair process also fixes the boot sector. This command overrides the default of writing to the system boot partition.

FIXMBR
fixmbr 

Use this command (where  is an optional device name that specifies the device that needs a new MBR) to repair the master boot record (MBR) of the system partition. Use this command if a virus has damaged the MBR and Windows cannot start.

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 recommends that you run antivirus software before using this command.

The name can be obtained from the output of the map command. If this name is left blank, the boot device's MBR is fixed, for example:

fixmbr \ \harddisk2

If Fixmbr detects an invalid or non-standard partition table signature, it prompts you for permission before it rewrites the MBR.

FORMAT
format : /q /fs: 

Use this command (where  is the drive letter of the partition to format and   specifies the type of file system to use [FAT, FAT32, or NTFS]) to format the specified drive to the specified file system. You can use the /q parameter with this command to perform a quick format of the drive.

If a file system is not specified, the existing file system format is used (when it is available).

LISTSVC
The listsvc command lists all available services, drivers, and their start types for the current Windows installation. You may want to use this command when you using the disable and enable commands.

NOTE: This information is extracted from the %SystemRoot%\System32\Config\SYSTEM hive. If the SYSTEM hive become damaged or missing, unpredictable results may occur.

LOGON
logon

When you use the logon command, a list all of the detected installations of Windows is displayed, and you are prompted for the local administrator password for the copy of Windows you want to log on to. If more than three attempts to logon do not succeed, the console quits and your computer restarts.

MAP
map 

Use this command (where the   parameter tells the map command to use ARC paths instead of Windows Device paths) to list drive letters, file system types, partition sizes and mappings to physical devices.

MD and MKDIR
Use the md or mkdir commands to 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.

MORE
more 

Use this command to display a text file to the screen.

RD and RMDIR
Use the rd and rmdir commands to 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 RENAME
Use the ren and rename commands to 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.

SET
Use the set command to display or modify four environment options.

AllowWildCards = FALSE

AllowAllPaths = FALSE

AllowRemovableMedia = FALSE

NoCopyPrompt = FALSE

SYSTEMROOT
Use the systemroot command to set the current working folder to the %SystemRoot% folder of the Windows installation that you are currently logged on to.

TYPE
type 

Use the type command to display a text file.

back to the top

Recovery Console Rules
Several environment rules are in effect while you are working in the Recovery Console. Type set to see the current environment. By default, the following rules are used:
 * AllowAllPaths = FALSE: This rule prevents access to folders and subfolders outside the system installation that you selected when you entered the Recovery Console.
 * AllowRemovableMedia = FALSE: This rule prevents access to removable media as a target for copied files.
 * AllowWildCards = FALSE: This rule prevents wildcard support for commands such as copy and del.
 * NoCopyPrompt = FALSE: This rule means that you are prompted by the Recovery Console for confirmation when you overwrite an existing file.

back to the top

How to Delete the Recovery Console
 Restart your computer, click Start, click My Computer, and then double-click the hard disk on which you installed the Recovery Console. Click Folder Options on the Tools menu, and then click the View tab. Click Show hidden files and folders, click to clear the Hide protected operating system files check box, and then click OK. At the root folder, delete the Cmdcons folder and the Cmldr file. At the root folder, right-click the Boot.ini file, and then click Properties. Click to clear the Read-only check box, and then click OK.</li> WARNING: If you modify the Boot.ini file incorrectly, the computer may not restart. Be sure to delete only the entry for the Recovery Console. Also, it is recommended that you change the attribute for the Boot.ini file back to a read-only state after you complete this procedure.

Open the Boot.ini file in Microsoft Windows Notepad, and then remove the entry for the Recovery Console. The Recovery Console entry looks similar to the following data:

C:\cmdcons\bootsect.dat=&quot;Microsoft Windows Recovery Console&quot; /cmdcons

</li> Save the file, and then close it.</li></ol>

back to the top

How to Install the Recovery Console During an Unattended Install
To install the Recovery Console during the unattended installation of Windows, use the [GuiRunOnce] section of the Unattend.txt file.

Command1=&quot; \winnt32 /cmdcons /unattend&quot;

For more information about how to use the Unattend.txt file, see the Deployment Planning Guide of the Windows 2000 Server Resource Kit. back to the top

<div class="references_section">