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.