If you’ve ever tried to fix a damaged Windows NT machine, you know how difficult it can be to do so. Part of the reason for this is that you can’t work with Windows NT from a command-prompt level unless Windows NT is running. Therefore, if you have a problem that prevents Windows NT from booting, you’re pretty much stuck. Assuming that you have enough free hard disk space, you can always install a second copy of Windows NT and use this copy to fix the original copy. However, using this process can really put your skills to the test if you need to do anything more than just basic file manipulation. Fortunately, Microsoft understands just how hard life can be. It’s built a tool into Windows 2000, called the Recovery Console, that does away with all these problems. In this Daily Feature, I’ll discuss the Recovery Console in detail and explain how to use it to fix various problems.

What is the Recovery Console?
The Recovery Console is a utility that’s built into Windows 2000. This utility allows you to boot a PC containing a damaged copy of Windows 2000 to a command line. From the command line, you may accomplish such tasks as enabling and disabling services and manipulating files, even if they’re stored on an NTFS partition.

Installing the Recovery Console
Unfortunately, the Recovery Console isn’t installed by default. To install the Recovery Console on a functional PC, insert the Windows 2000 CD into the CD-ROM drive. When you see the Windows 2000 splash screen, close it. Now, open an MS-DOS Prompt window and navigate to the CD’s I386 folder (or the ALPHA folder if you’re using an Alpha PC). At this point, execute the following command:
WINNT32 /CMDCONS

Running this command will install the Recovery Console. We should warn you that the Recovery Console requires 74 MB of hard disk space. Once the Recovery Console is installed, you’ll be able to access it through a choice on the boot menu. If your copy of Windows 2000 is already damaged and you can’t install the Recovery Console in this way, don’t worry. There are other ways of accessing the Recovery Console. I’ll discuss these methods later on.

Accessing the Recovery Console
Once you’ve installed the Recovery Console, you can access it by rebooting your PC and selecting the Recovery Console command from the boot menu. You’ll then be prompted to log into Windows 2000. You must log in using the Administrator account. If you’ve configured your system to act as a dual-boot or if you have multiple installations of Windows 2000, you must select the installation you want to work with before typing the Administrator’s password.

Recovery Console commands
Upon arriving at the command prompt, you may be a bit puzzled as to what to do next. After all, it’s not every day that you use the command prompt to repair Windows NT. Below, I’ve included a sample of some of the commands that will work in the Recovery Console.

ATTRIB With the ATTRIB command, you can add or remove various file attributes, such as hidden or read-only.
CHDIR (or CD) Allows you to change to a different directory.
CHKDSK Checks the hard disk for errors and displays a status report. You can append the /F switch to get CHKDSK to fix the errors that it finds.
CLS Clears the screen.
COPY Copies files from one location to another.
DELETE (or DEL) Erases the files specified.
DIR Displays the directory’s contents.
DISABLE Disables a service or a device driver.
DISKPART Allows you to create, delete, and manage partitions on your hard disk.
ENABLE Enables a service or a device driver.
EXIT Closes the Recovery Console and reboots the computer.
EXTRACT Allows you to extract individual files from the compressed files on the Windows 2000 CD.
FDISK Allows you to create, delete, and manage partitions on your hard disk.
FIXBOOT Writes a new boot sector onto the system partition.
FIXMBR Repairs the master boot record of the partition’s boot sector.
FORMAT Allows you to format a disk or a partition.
HELP Displays all commands that are available through the Recovery Console.
LISTSVC Lists all available system services.
LOGON Allows you to log into the security system of the Windows 2000 installation of your choice.
MAP Displays mappings for network drives.
MKDIR (or MD) Creates a directory.
MORE Displays a text file’s output one screen at a time.
RMDIR (or RD) Removes a directory. The directory must be empty before you can remove it.
RENAME (or REN) Allows you to rename a file.
SYSTEMROOT Sets the current folder to the systemroot folder of the system that you’re currently logged into.
TYPE Displays the contents of a text file.

Command help
A list of commands does little good if you don’t know how to use them. Most of the commands that I’ve discussed are left over from MS-DOS. All of the standard DOS switches work with these commands. For example, you can use the /P switch with the DIR command to display one page of the directory at a time just like you could in a DOS environment. If you’re a little rusty on the DOS commands, help is always available. You can access help at any time by typing the HELP command. This will display a list of available commands and their functions. If you need help with a specific command, you can type the command followed by the /? switch. Doing so will display the command’s syntax. For example, to get help using the FORMAT command, type the following command:
FORMAT /?

A sample repair
Now that you know how to get help with the commands, let’s walk through a sample repair routine. Suppose you have a PC that is low on disk space and has a malfunctioning service that prevents the PC from booting. Now suppose you add an extra hard disk to the computer to help with the disk space problem. Of course, it’s rare that these two problems would become critical at the same time in real life, but using such a situation gives us the chance to provide you with a better demonstration of the Recovery Console’s capabilities.

Let’s begin by tackling the disk space problem. Because you’ve just installed a brand-new hard disk, it hasn’t been prepared for use yet. You can do so by using the FDISK command. I won’t list the exact steps involved in the FDISK command because they’ll be different for everyone. Following my steps literally could be disastrous to your system. The idea, though, is to create at least one partition on the new hard disk.

Once you’ve created the new partition, you need to format it. Before doing so, you need to know which drive letter FDISK assigned to it. If FDISK assigned the letter E to your new partition, you could format it using the following command:
FORMAT E:

Once you’ve formatted the drive, you need to move some of your data over to it. You can do so by selecting a directory containing data and creating a duplicate directory on the new drive. Next, you copy the files from your old disk to the new one and remove the original copy. Below is a sample of this procedure:
E:
MD MYDATA
C:
CD\MYDATA
COPY *.* E:\MYDATA
ERASE *.*
CD\
RD MYDATA

Now, let’s discuss the malfunctioning service. Suppose you’ve determined that the Alerter service is causing your problem. The first thing you should do is use the LISTSVC command to determine the exact name of the service. Once you’ve determined the exact name for the Alerter service (Alerter), you can disable it. To do so, type the command
DISABLE ALERTER

then press the [Enter] key.

Upon doing so, you’ll be informed that the Alerter service has a start type of SERVICE_AUTO_START but that it has now been disabled with a start type of SERVICE_DISABLED.

At this point, you’ve fixed the disk space problem, and you’ve made the computer bootable by disabling the service that was causing your problem. You can now type the EXIT command to reboot the PC and launch Windows 2000 in its normal graphical mode.

Alternative Recovery Console installation methods
In the examples that I’ve used so far, I’ve discussed installing the Recovery Console on a working PC. But what if your PC isn’t working? In the final release of Windows 2000, you’ll be able to use the four boot disks or the Windows 2000 CD-ROM to install the Recovery Console.

To do so, boot your PC off the Windows 2000 CD-ROM, if possible. If your PC can’t boot from the CD, boot from Setup Disk 1. As Setup launches, you’ll be asked if you want to begin installing Windows 2000. Press [Enter] to continue. Next, Setup will ask you if you want to continue installing Windows 2000 or repair an existing installation. Press the [R] key to start repairing the damaged installation. When you do, you’ll be prompted as to whether you want to repair your system using the Recovery Console or the emergency repair process. From this point, follow the prompts to install the Recovery Console.

Conclusion
One of Windows NT’s downfalls has always been that it’s difficult to access the system when a repair is needed. Fortunately, Windows 2000 gets around this problem by providing you with a command-line interface known as the Recovery Console. The Recovery Console allows you to manipulate most aspects of Windows NT through the command prompt whether or not the PC is functional.

Brien M. Posey is an MCSE and works as a freelance technical writer and as a network engineer for the Department of Defense. If you’d like to contact Brien, send him an e-mail. (Because of the large volume of e-mail he receives, it’s impossible for him to respond to every message. However, he does read them all.)

The authors and editors have taken care in preparation of the content contained herein, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for any damages. Always have a verified backup before making any changes.

Subscribe to the Microsoft Weekly Newsletter

Be your company's Microsoft insider by reading these Windows and Office tips, tricks, and cheat sheets. Delivered Mondays and Wednesdays

Subscribe to the Microsoft Weekly Newsletter

Be your company's Microsoft insider by reading these Windows and Office tips, tricks, and cheat sheets. Delivered Mondays and Wednesdays