Southern Iowa's Leading Office Outfitters

                      • Home • Up • News • Services • Downloads • Tech Tips •             

Recovering Windows XP Using the Recovery Console

 

Home
Up
Protect your PC
Security Alerts
What's New
Service Call
Promotions
F.A.Q
Terms of Sale
Contact Us
About Baileys
Careers
 

 

Copywrite Microsoft Corp,
So Windows won’t boot and you’ve exhausted your troubleshooting arsenal? No worries, there is a nifty technique to help you diagnose and repair a system that will not boot Windows called Recovery Console.
Recovery Console is set of commands enabling you to perform many troubleshooting and maintenance tasks, such as disabling problem drivers and services that you suspect are causing startup problems. If you cannot start Windows XP Professional in safe mode or normal mode, Recovery Console does the following:
  • Grants limited access to local NTFS and file allocation table (FAT) formatted volumes and is separate from the command-line Cmd.exe shell.
  • Is run directly from the Windows XP Professional operating system CD, or it can be installed to a hard disk as a boot menu option.
In this article we’ll give three examples of how to use the Recovery Console to repair Windows boot problems.
  1. How to disable a failing driver to boot Windows to the desktop
  2. Using the Recovery Console to replace the MBR
  3. Replacing the boot sector
In addition, here are the Recovery Console Commands you can use.

So how do you add Recovery Console to the Windows boot option? By default the Recovery Console is not installed onto Windows since a curious customer could potentially tank their Windows by experimenting with Recovery Console commands. The following is the step-by-step process to install the Recovery Console to the hard disk.

 
 
Step-by-Step Recovery Console Installation
 
  1. Insert the Windows Setup CD. If AutoRun is enabled, close the Windows XP Setup screen that appears.
  2. Click Start, Run, type G:\i386\winnt32.exe /cmdcons (In this example, G:\ is the CD Drive), and then click OK to continue.

         
    The Windows Setup message box will open. In the Windows Setup message box, click Yes to confirm Recovery Console installation.

         
     
  3. Recovery Console setup will next attempt to access the Internet and perform a Dynamic Update to the installation files. If you don’t wish to perform the update, press [Esc] to interrupt the Dynamic Update process and use the existing setup files.

         
  4. Once the Dynamic Update is completed, the Microsoft Windows XP Professional Setup screen shown below will track the installation progress of Recovery Console as the files are copied and system files updated to place the Recovery Console on the Boot Menu.

         
  5. Upon completion of the Recovery Console install, the dialog box below is displayed to confirm a successful installation. Click OK and restart the computer.

         

Now if you don’t want to install the Recovery Console, you can still access it using the Windows XP CD. Simply insert your Windows XP installation CD-ROM and boot from CD-ROM. On the "Windows XP Professional Setup" menu, select "R" for Recovery Console. Type the number corresponding to the installation that you want to use, and then press ENTER. At the prompt, enter the password for the local Administrator account to access the contents of the local hard disk. Recovery Console accepts only the local Administrator account password.

Before going into the example troubleshooting scenarios there are some key tips to take note of. On many XP installations you can't start the Recovery Console because it won't recognize your password.

This registry edit causes the Recovery Console not to ask for a password. This works for both XP Home and XP Professional.

  1. Click Start, Run, and type Regedit.
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Setup\RecoveryConsole.
  3. Set the DWORD SecurityLevel value to 1
  4. Exit Regedit and Reboot your computer.

By default you’ll only have access to the following:

  • Root Directory of all Disks
  • Windows System Directory
  • Removable Disks

You’ll not have access to other directories, nor can you copy files to removable media. To circumvent this problem you’ll want to do the following registry change.

  1. Click Start, Run, and type Regedit.
  2. Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Setup\RecoveryConsole.
  3. Set the DWORD SetCommand value to 1.
  4. Exit Regedit and Reboot your computer.

After you have enabled this, when you enter the Recovery Console, you can change the environment settings with the set command by using the set variable = TRUE or FALSE syntax.

Note: Be sure to use a space on each side of the equal sign. If you do not, the set command generates a "syntax error" error message and does not work.

The following variables define the default environment. The variables, when set to TRUE, enlarge the scope of the environment setting and have the following meanings:

  • AllowWildCards = TRUE Enable wildcard support for some commands (such as the del command)
  • AllowAllPaths = TRUE Allows access to all files and folders on the computer
  • AllowRemovableMedia = TRUE Allow files to be copied to removable media, such as a floppy disk
  • NoCopyPrompt = TRUE Do not prompt when overwriting an existing file

To see the current settings for the environment, type set without parameters at a command prompt.


Return To Top
 
How to Disable a Failing Driver to Boot Windows to the Desktop
  1. Enable boot logging options and reboot the machine:
    At the Recovery Console prompt, type the command bootcfg /add to add a new entry to the boot.ini file. It will ask you which installation of Windows you would like to add an entry for. Select the desired Windows installation and press Enter.

    Example: 1: C:\Windows

    When it prompts for the Load Identifier, enter a friendly name that will be presented as a boot menu option.

    Example: Microsoft Windows XP Professional (Boot Logging)

    When prompted for the OS Load Options, type /sos /bootlog and press Enter. This will return you to the command line prompt. At this point, you can type exit to reboot the machine and select this boot logging option from the boot menu option.
  2. Review the bootlog file:

    If the machine hangs on boot, you can view the last driver that the machine tried to load. If the machine just reboots, you can now go back into the Recovery Console to view your bootlog. At the Recovery Console command prompt, navigate to the C:\Windows directory and enter the command type ntbtlog.txt. The last entry in the log file is where the machine hung or crashed, remember this driver name.
  3. View a list of running services and drivers:

    At the Recovery Console command prompt, enter the command listsvc to display a list of all running services and drivers. Find the name of the service or driver that is causing your machine to crash in the list. This name is typically the same name of the driver minus the driver file extension.
  4. Disable the Driver or Service:

    After you know the name of the faulty service or driver, you can disable it using the disable command. At the Recovery Console command prompt, type disable followed by the service or driver name and press Enter.

    Example: disable ialm

    This disables the service or driver. You are ready to reboot the system which will, hopefully, not crash or hang during the Windows boot.

     
  5. Remove the boot.ini entry:

    After successfully entering windows and correcting the driver problem, you will want to remove the boot logging option in the boot.ini file.

    Open the boot.ini file, located at "C:\boot.ini" in Notepad, make sure the read-only flag is cleared from the file, and delete the boot logging entry created in Recovery Console.

    Example: multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional (Boot Logging)" /sos /bootlog

    Save the file and reboot to verify the machine performs as it should.

Return To Top

 

Replacing the Boot Sector
If Ntldr is damaged or missing, or if the boot sector is corrupted, you can resolve either problem by using the Recovery Console.

To start the computer and use the Recovery Console to replace the boot sector:
  1. Insert the Windows XP Professional Setup CD-ROM into the CD-ROM drive.
  2. Restart the computer. If prompted to press a key to start the computer from the CD-ROM, strike a key on the keyboard.
  3. When the text-based part of Setup begins, follow the prompts. Press the R key when prompted to repair a Windows XP Professional installation.
  4. If you are repairing a system that has more than one operating system installed, from the Recovery Console choose the Windows XP Professional installation that you need to repair.

    Notes:
    • If you press ENTER without typing a number, the Recovery Console quits and restarts the computer.
    • The Recovery Console might also show valid installations of Windows NT 4.0. However, the results of attempting to access a Windows NT 4.0 installation can be unpredictable.
  5. When prompted, type the Administrator password. If you do not have the correct password, or if the security database for the installation of Windows XP Professional that you are attempting to access is corrupted, Recovery Console does not allow access to the local disks and you cannot replace the boot sector.
  6. To replace the boot sector, at the Recovery Console command prompt, type: fixboot [drive:]

If you do not specify a drive letter, the Recovery Console replaces the boot sector of the system volume. If you need to replace the boot sector of a volume that is not the system volume, then you must specify the appropriate drive letter.


Return To Top

Using the Recovery Console to Replace the MBR
 

 
You can use the fixmbr command in Recovery Console to rewrite the MBR to resolve a corrupted MBR on a startup disk. However, running fixmbr overwrites only the master boot code, leaving the existing partition table intact. If the corruption in the MBR affects the partition table, running fixmbr might not resolve the problem.

Cautions

  • Use this command with care because it can damage your partition table if any of the following apply:
    • A virus is present and a third-party operating system is installed on the same computer.
    • A nonstandard MBR is installed by a third-party disk utility.
    • A hardware problem exists.
  • It is recommended that you run antivirus software before you use the fixmbr command.

To start the computer and use the Recovery Console to replace the MBR:

  1. Insert the Windows XP Professional Setup CD-ROM into the CD-ROM drive.
  2. Restart the computer. If prompted to press a key to start the computer from the CD-ROM, strike a key on the keyboard.
  3. When the text-based part of Setup begins, follow the prompts. Press the R key when prompted to repair a Windows XP Professional installation.
  4. If you are repairing a system that has more than one operating system installed, from the Recovery Console choose the Windows XP Professional installation that you need to repair.

    Notes
    • If you press ENTER without typing a number, the Recovery Console quits and restarts the computer.
    • The Recovery Console might also show valid installations of Windows NT 4.0. However, the results of attempting to access a Windows NT 4.0 installation can be unpredictable.
  5. When prompted, type the Administrator password. If you do not have the correct password, or if the security database for the installation of Windows XP Professional you are attempting to access is corrupted, Recovery Console does not allow access to the local disks and you cannot repair the MBR.
  6. To replace the MBR, at the Recovery Console command prompt, type: fixmbr

Verify if you want to proceed. Depending upon the location and the cause of the corruption within the damaged MBR, this operation can cause the data on the hard disk to become inaccessible. Press the Y key to proceed, or press the N key to cancel.


Return To Top

Recovery Console Commands
 

 
CommandDescription
Attrib Changes the attributes of a file or directory.
Batch Executes the commands specified in the text file.
Bootcfg Boot file (boot.ini) configuration and recovery.
CD (Chdir) Displays the name of the current directory or changes the current directory.
Chkdsk Checks a disk and displays a status report.
Cls Clears the screen.
Copy Copies a single file to another location.
Delete (Del) Deletes one or more files.
Dir Displays a list of files and subdirectories in a directory.
Disable Disables a system service or a device driver.
Diskpart Manages partitions on your hard drives.
Enable Starts or enables a system service or a device driver.
Exit Exits the Recovery Console and restarts your computer.
Expand Extracts a file from a compressed file.
Fixboot Writes a new partition boot sector onto the specified partition.
Fixmbr Repairs the master boot record of the specified disk.
Format Formats a disk.
Help Displays a list of the commands you can use in the Recovery Console.
Listsvc Lists the services and drivers available on the computer.
Logon Logs on to a Windows installation.
Map Displays the drive letter mappings.
Mkdir (Md) Creates a directory.
More Displays a text file.
Net Use Connects a network share to a drive letter.
Rename (Ren) Renames a single file.
Rmdir (Rd) Deletes a directory.
Set Displays and sets environment variables.
Systemroot Sets the current directory to the systemroot directory of the system you are currently logged on to.
Type Displays a text file.

Return To Top

Recovery Console is a very useful tool for troubleshoot booting problems. You are encouraged to test it out in a virtual PC environment running Windows. This way you can feel confident in testing out different commands and techniques.

 

 

Home ] Up ] Next ]

Send mail to Webmaster with questions or comments about this web site.
Copyright © 2006 Bailey Office Equipment
Last modified: 07/21/08