Using the Recovery Console to Change Service and Driver Startup Settings

One very common reason for boot issues on an XP system is problems with loading drivers and system services, which may be unstable, damaged, or corrupted. Use the Enable Boot Logging advanced startup option to try to determine the driver or system service name causing a failure, or even a filename referenced in any error messages you might receive when trying to boot XP normally. This information is useful, since the Recovery Console allows you to configure the startup settings with drivers and system services, selectively disabling them or changing their startup settings if necessary.

The listsvc command displays a list of all critical drivers and system services, and displays information about their current settings – for example if they are configured to start automatically, manually, or if they are disabled. The enable command allows you to enable a service or driver, and control its startup setting. For example, the command enable messenger SERVICE_AUTO_START would configure the Messenger service to start automatically. The disable command disables a service, just as the name suggests. Try disabling drivers or services which you suspect of causing boot problems, but be sure to write down their current settings first, just in case you need to change them back.

Configuring Recovery Console Environment Variables

The Recovery Console set command allows you to configure environment variables, and these you’ll definitely want to take a look at. The 4 configurable variables have values of either TRUE or FALSE, and are all set to FALSE by default:

AllowWildCards – enables wildcard support for some commands, for example del *.txt

AllowAllPaths – allows access to all files and folders on the computer

AllowRemovableMedia – allows files to be copied from removable media, such as floppy disks

NoCopyPrompt – will no prompt when attempting to overwrite existing files.

The set command is not enabled by default, but can be enabled on both XP Home and Professional via the Registry. Access the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Setup\RecoveryConsole key in Regedit and change the value of SetCommand from 0 to 1. Then, change the values of the environment variables outlined here to TRUE with the set command and you’re off to the races.

Once your foray into the Recovery Console is complete, use the exit command to quit the environment and reboot your system.

Recovery Console Disk and Boot Tools

Handy disk tools included with the Recovery Console include chkdsk, diskpart, and format. Just like their XP equivalents, the chkdsk command is used to check a partition or volume for errors and repair them, while the format tool allows you to do just what you’d expect – format a partition if necessary. If you need to create or delete partitions, then diskpart does the job; think of it as a command-line version of the Disk Administrator tool and you get the picture.

Not being able to boot into XP can happen for a variety of reasons, but two of the most common are problems with the boot sector code on the system partition, and a corrupted master boot record (MBR) on the boot partition. If the boot sector on your system appears to be damaged, run the fixboot command. If the MBR has somehow become corrupted (usually via a virus), then the fixmbr command is the way you’ll want to go. The fixmbr command can result in inaccessible partitions, so be sure to scan for MBR viruses (if possible) prior to running the command.

Issuing Batch Commands with the Recovery Console

One of the more interesting capabilities of the Recovery Console is its ability to execute “batched” commands stored in a text file. For example, you could create a text file that contains a number of Recovery Console commands on another system (one per line), copy that file to the system, and then use the batch command to execute the file. The text file is used as input for the batch command and will display results onscreen. If you supply an output filename, the command result will be written to that file. This is an excellent capability, especially if you need to execute the same commands from the Recovery Console of many XP systems.

Managing File with Windows XP Recovery Console

The first Recovery Console tools that we’ll explore and those associated with managing files and navigation functions. These commands will seem familiar to command-line users, but knowing them is critical when it comes to navigating between directories, removing directories, and renaming files.

Let’s begin with a look at navigation. The cd command is used to change directories, for example cd \cmdcons will move you into the \cmdcons directory. The chdir command is also used to change directories, but only within system folders. For example, to switch from C:\Windows to the system32 folder, the correct command would be chdir system32. Play around with these commands a bit and you may notice that the Recovery Console is actually less concerned with which command you use in most cases. If your screen is becoming cluttered and you need a little room, use cls to clear the screen. As you might expect, the dir command will provide you with a standard listing of the contents of a folder.

If you need to delete a file, you’ll need to be familiar with the del and delete commands. The del command is used to delete a file outside of a system directory, while the delete command is used to delete files within system directories. The ren command renames a file outside of system directories, while the rename command is used within. The md command allows you to create new directories in non-system directories, while mkdir handles the task within. Finally, rd removes a non-system directory, while rmdir handles the task for system folders. If you find these dual-commands confusing, remember that the longer version is always used with system directories (such as %systemroot%), while the shorter command is used for all non-system folders.

The attrib command is almost identical in function to its normal command-line counterpart. This utility allows you to add or remove attributes from a file when necessary, including read-only, system, hidden, and compressed. A common use of this command is to remove the read-only attribute from a file you have copied from a CD, with a syntax of attrib –R filename. When in doubt about syntax, always head back to the command name following by /? for help and details.

If you want to view the contents of a text file, you have the choice of using either the more or type command. This will display the contents of the file onscreen, but unfortunately will not allow the contents of the file to be edited. No text editing tools are provided with the Recovery Console. If you need to change the contents of a text file, you’ll need to create it (or copy it) from another system, and then copy the file to the Recovery Console from a floppy disk or CD. A bit of a pain we know, but simply a reality of the environment.

Two of the most useful Recovery Console file tools are the copy and expand commands. The copy command is very much what you’d expect, allowing you to copy files within accessible directories, or from a removable disk (if enabled via the set command, which is explored later in this article). The expand command is useful when a file has been corrupted and you want to copy over the compressed version from the Windows XP installation CD.

Getting Help in XP’s Recovery Console

Although experienced command line users will find the Recovery Console environment very similar to the XP command line, the available command set is much smaller, and some tools that you might have come to expect (like the Edit program) will not be available. Your best friend when using the Recovery Console will always be the help command, which displays a list of available commands, and the /? switch, which can be added to the end of any command to review detailed information on the various switches available for a command and the proper syntax to use.

Recovery Console Restrictions and Limitations

Although the environment itself looks an awful lot like the MS-DOS command line, the Recovery Console isn’t nearly as full-featured as even the normal Windows XP command line. Instead, the various utilities provided are aimed at repairing or recovering an installation, and little else.
Some of the main limitations of the Recovery Console that you should be aware of include that fact that it only provides access to the root folder (C:), the %systemroot% folder and its subfolders, the Cmdcons folder, and removable media drives such as your floppy disk and CD/DVD-ROM drive. Attempting to access any other folder results in an Access Denied message. This shouldn’t be a big issue, since you will have access to any files that could be impairing XP’s ability to boot successfully.

One additional limitation that you should be aware of is the fact that the Recovery Console will allow you to copy files from a CD, DVD, or floppy disk to a local directory, but it will not allow you to copy files from a local directory to these media sources – just something to keep in mind.

Logging on to the Windows XP Recovery Console

Once you select the Microsoft Windows Recovery Console option from the operating system selection menu, the software boots and you are prompted to select an installation to log on to. This option exists for systems that have multiple copies of XP installed, such as a dual-boot installation with versions of XP residing on drives C and D, for example. If you have only a single installation of XP, type 1 at the prompt and press Enter. Otherwise, type the number associated with the installation you are trying to recover.

Once the operating system is selected, you need to log on using the local Administrator account in order to gain access to the console. Other users do not have the ability to log on to the Recovery Console, so you’ll need to ensure that you have this password handy. Once you’ve submitted the Administrator password and pressed Enter, you’re logged in at the command line with focus on the %systemroot% directory, which is typically C:\Windows. The logon command can be used to change the version of XP you are logged on to if multiple instances exist.

Booting Into the Windows XP Recovery Console from CD

Although having the Recovery Console installed in advance of requiring it is handy if you run into problems booting XP, you can still get by without it as long as you have your Windows XP CD handy. To start the Recovery Console on an XP system where it hasn’t been installed, simply boot from the XP CD as if you were about to begin reinstalling the operating system. When you get to the Windows XP Setup screen, press the R button to select the option to repair a Windows XP installation using the Recovery Console. Doing so will load the console on your system for immediate access, but does not install it for future use. As a general rule, make installing the Recovery Console a priority, so that you won’t need to hunt around for the installation CD when problems arise.

Installing and Using the Windows Recovery Console

Windows XP systems can experience problem during the boot process or fail to boot for a variety of different reasons. Some of the files required by the boot process might be corrupted or missing, drivers or services might fail to load, or a virus may have infected your system’s master boot record (MBR). Under normal circumstances, your first courses of action should be to try to boot a system into Safe Mode, try the Last Known Good Configuration option, or even attempt to repair the system using the Automated System Recovery (ASR) feature. Although each of these options will often help to get you back up running again, sometimes they’re not enough. For this reason, Microsoft provides an advanced command line environment to help you attempt to repair or recover an XP system manually. Known as the Recovery Console, this is one tool you’ll want to know more about before you need to use it!

Provided with both the Home and Professional versions of Windows XP, the Recovery Console software is not installed by default. To install the software (which requires only 7 MB of free disk space), pop in your Windows XP installation CD and issue the WINNT32 /cmdcons switch from the Run command. This will walk you through the Recovery Console installation process, and add an option to boot into the Recovery Console from the operating system selection menu provided when XP boots.