Install
and Use the Recovery Console in Windows XP Professional
If
any of you have met Cleve you will understand what I mean when I say he is one
of the most colorful persons I have met. Keep up the good work Cleve ! Will
Hawkins
I received a request from
one of our System Builders, Chris Peacock, from Australia, to present a tip on
using the Recovery Console in the Microsoft® Windows® XP Professional
operating system. So, here you are everyone. And, thank you, Chris! This is
absolutely one of the most worthwhile consoles to install onto your system.
When I train on the
Recovery Console, I always ask the question: "When can we use an MS-DOS®,
Windows 98 Second Edition, or Windows Millennium Edition boot disk to boot to a
Windows XP Professional installation using the NTFS file system?" The
answer is: You can never use an MS-DOS anything to gain access to any
resources on an installation using the NTFS file system, because MS-DOS cannot
see anything on the NTFS file system.
So three cheers for the
Recovery Console! Without it—and with Microsoft Windows NT® Workstation
operating system version 4.0, we were without it—you were somewhat crippled
(That’s an understatement!).
Tip:
Some of you may say, legitimately, that we still have Safe Mode. Yep, you’re
right. That is true. But there are some advantages of using the Recovery Console
over Safe Mode. The biggest advantage of the Recovery Console over Safe Mode,
for all of us, is that it works even when your Windows system files are
corrupted. You can perform any of the following tasks using the Recovery
Console:
- Use, copy, rename, or replace the Windows system files
and folders.
- Enable or disable services or devices, with the
changes taking effect the next time that you start Windows.
- Repair the file system boot sector and the Master Boot
Record. (This is a big one for System Builders!)
- Rebuild or repair the boot menu.
- Create and format drives.
I really think that you
should install the Recovery Console on every system that you build and ship to
your customers.
To install the Recovery
Console:
- With Windows XP Professional installed on the system,
insert the Windows XP Professional CD into the CD drive and click Start
and Run.
- Browse the CD, navigate to the \i386 folder, and
double-click Winnt32.exe.
Tip:
When you are using the 64-bit platform, you will navigate to the \ia64 folder
instead of the \i386 folder. The rest of the command is exactly the same for
both platforms.
- Place your cursor at the end of the line X:\i386\winnt32.exe,
press the SPACEBAR, type /cmdcons, and click OK.
- The Windows Setup message states that you can install
the Recovery Console. If the Recovery Console won’t start from the
computer’s hard disk, then you can start it from the Windows Setup CD. The
approximate size of space required is 7 MB.
Click
Yes, and you will see the Copying Installation Files page. This indicates
that the Recovery Console is being installed, right before your very eyes!
- Once the installation of the Recovery Console is
complete, you will see a message that states that the Recovery Console has
been successfully installed. It also explains how to gain access to the
Recovery Console.
Click
OK.
If you choose not to
install the Recovery Console, you do have the option to run the Recovery Console
directly from CD.
To run the Recovery
Console from CD:
-
Place the Windows XP Professional CD into the CD-ROM
drive, and reboot or restart the computer.
-
When you are presented with the message that says
"Press any key to boot from CD," press ENTER and allow the
setup file to load.
-
When you see the "Welcome to Setup" screen,
press R for Recovery.
-
Choose which installation to repair, using the number
in front of the installation. You will be presented with the path to the
boot partition, which holds the installation files. For Windows XP, the path
will be C:\Windows.
-
Type the password for the local Administrator for this
computer.
To use the Recovery
Console to start the computer after you have installed it:
-
Restart the system.
-
When you are presented with the Startup or Operating
System Selection menu, press the DOWN ARROW key to select the
Recovery Console and press ENTER.
-
Choose the number that represents the installation
that you want to repair. (As long as you are not dual-booting this system,
you should have a single installation of the Windows XP Professional
operating system.) You are presented with the path to the boot partition,
where the installation files reside. On a Windows XP Professional system,
you will see: C:\Windows.
Press
1 and press ENTER.
-
Type the case-sensitive password for the local
Administrator. (You will have three chances to get it right. If you don’t
get it right, the computer will automatically reboot.)
-
Once you have typed the password, press ENTER.
A command prompt is displayed: C:\Windows.
Tip:
To see the commands that are available to you, type Help and press ENTER.
Once the commands are displayed, if you need to get help for a command, type
that command, press the SPACEBAR, type /?, and press ENTER. For example,
if you want to see what Listsvc does, type Listsvc /? and press ENTER.
After logging on to the
Recovery Console, you can access files only in the following locations:
-
The root directory of any volume.
-
The %SystemRoot% folder and subfolders of the selected
Windows XP installation. For Windows XP Professional, this would be
C:\Windows.
-
The Recovery Console Cmdcons folder and any
subfolders—that is, if you installed the Recovery Console as a startup
option.
-
The files and folders on removable disks including
floppy disks, CDs, and Zip disks.
Think about this for a
minute! The Recovery Console is a very powerful tool. In the wrong hands and if
used improperly, your files are jeopardized. So, if the Recovery Console were to
allow unlimited access to files and folders on your hard disk, it would pose a
serious security hole. This would be of utmost importance to systems running
Windows XP Home Edition. Why? Because the Administrator password is blank.
Microsoft needed to help you by preventing unauthorized access. Therefore, the
Recovery Console imposes the following limits on your actions when you log on:
-
If you try to access folders other than those
described in the previous list, you will receive an "access
denied" message. You cannot read from or write to the following
folders: Program Files, Documents And Settings, and disks or folders
containing other Windows installations. These restrictions apply to both
NTFS and FAT32 volumes.
-
Write access to removable disks is disabled—period.
This prevents you from copying files to floppy disks and other removable
media. If you try to copy a file to a removable disk, you receive an
"access denied" message.
-
You cannot change the local Administrator account
password from the Recovery Console. If you use Windows XP Home Edition, just
try to add a password to the local Administrator account!
-
No text editing tools are available in the Recovery
Console.
Here is the list of
commands and what they can do for you:
|
Attrib
|
Sets or clears attributes (Read Only,
Hidden, System) for a single file or folder.
|
|
Batch
|
Executes commands from a text file.
|
|
Bootcfg
|
Automatically scans all local disks for
Windows installations, and configures and repairs the entries in the
operating system menu (the Boot.ini file).
|
|
Cd
or Chdir
|
Changes folders
|
|
Chkdsk
|
Checks and, if needed, repairs or
recovers a drive. It marks bad sectors and recovers readable information.
This command requires that the Autochk.exe command be located in the %SystemRoot%\System32
folder or on the Windows CD.
|
|
Cls
|
Clears the screen.
|
|
Copy
|
Copies a file.
|
|
Del
or Delete
|
Deletes a single file.
|
|
Dir
|
Displays the folder contents and
attributes for all files in the specified folder, including hidden and
system files.
|
|
Disable
|
Disables a service or driver.
|
|
Diskpart
|
Manages the partitions on basic disk
volumes. Please note that this command is not the same as the one
available at a normal command prompt. Never use this command with dynamic
disks.
|
|
Enable
|
Enables a service or driver.
|
|
Exit
|
Closes the Recovery Console and restarts
the computer.
|
|
Expand
|
Extracts a file from a compressed (.cab)
file on a local disk or removable media such as the Windows CD.
|
|
Fixboot
|
Writes a new partition boot sector onto
the partition that you specify.
|
|
Fixmbr
|
Repairs the Master Boot Record of the
specified disk. This is usually the system partition that holds the boot
files for the system. It formats a primary partition, volume, or logical
drive using the file system you specify.
|
|
Help
|
Displays a list of available commands in
the Recovery Console.
|
|
Listsvc
|
Lists all available services and drivers
and their current start types.
|
|
Logon 2000
|
Lists all detected installations of the
Microsoft Windows and Windows NT® operating systems, and allows you to
choose which installation you want to log on to. Remember, if you type an
incorrect password three times, the system automatically restarts.
|
|
Map
|
Lists drive letters, file system types,
partition sizes, and mappings to physical devices. It is intended for use
with basic disks only and may return inaccurate information when used with
dynamic disks.
|
|
Md
or Mkdir
|
Creates a new folder or subfolder in the
specified location.
|
|
More
|
Displays a text file, pausing at each
screen. Use the ENTER key and the SPACEBAR to scroll through a file one
line at a time and one screen at a time, respectively.
|
|
Rd
or Rmdir
|
Removes a folder.
|
|
Ren
or Rename
|
Renames a folder
|
|
Set
|
Displays or modifies Recovery Console
environment variables.
|
|
Systemroot
|
Sets the current folder to the %SystemRoot%
folder of the current Windows installation.
|
|
Type
|
Displays a text file.
|
Tip: In
99.999 percent of cases, the most common cause of problems with boot files is
the improper use of third-party disk utilities or when you guys try to create a
dual-boot system. Don’t use dual-boot systems. I say it all the time.
If the setup program for
another operating system is incompatible with Windows XP, it most likely
overwrote or damaged the startup files. Following is a short list that may help
with some repair techniques that are available from the Recovery Console.
-
The Boot.ini file is corrupt or missing from
the Recovery Console.
Type bootcfg /scan to list all of the available Windows installations
on all the available disks. Use bootcfg /rebuild to automatically
replace the existing Boot.ini file. Use bootcfg /add to append a
Windows installation to the Boot.ini file without changing existing entries.
-
Critical system files are damaged or missing.
You can restore Ntldr, Ntoskrnl.exe, Ntdetect.com, and driver files from the
Recovery Console. If the file exists on the Windows CD, use the Copy command
in the Recovery Console. Type the source and destination path of the file.
Windows expands compressed files automatically. If the file is stored within
a .cab file, like the Driver.cab file, you will need to use the Expand
command to gain access to the file.
-
Another operating system replaced the Windows
XP boot sector code.
Start the Recovery Console from the Windows CD. (If you installed the
Recovery Console, you will not be able to boot to the Startup menu.) Then,
use the Fixboot command to rewrite the boot sector code. Finally, reboot
your computer.
Tip:
One final thing! If the Recovery Console will not work after you use Sysprep,
check out Q308402
in the knowledge base. That will tell you how to get the fix.
Whoa, Nelly! I think I got
carried away here. Every time I started to write something, it rattled my brain,
and I said, ‘Oh, yeah, Cleve, don’t forget to tell them about this and then
that and then that and that and that!’ Time to stop! Thank you to Mr. Chris
Peacock, from Australia, for asking for this tip. Send what-did-you-think-of-it
e-mail to me: clevek@microsoft.com.
© 2002 Microsoft Corporation.
All rights reserved.
This document is for
informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED,
IN THIS SUMMARY.
Microsoft, MS-DOS,
Windows, the Windows logo, and Windows NT are either registered trademarks or
trademarks of Microsoft Corporation in the United States and/or other countries.
Microsoft OEM products are
licensed to system builders by Microsoft Licensing, Inc., a wholly owned
subsidiary of Microsoft Corporation.