View Full Version : WXPTFTW - Windows XP Tips for the Weekend - 24Jan03

Babe Ruth
24-01-2003, 02:01 PM
WXPTFTW - Windows XP Tips for the Weekend

Tips are from various sources, with thanks this week to Microsoft.

Only one tip this weekend but it's a biggie so bear with us...
you may want to select/cut/paste to store this information for your own benefit.

1. Recovery Console - The doctor is (maybe) in (perhaps)!

As always if you are going to modify the registry of your system, back it up first.
{START | RUN type Regedit and click OK.

Within regedit right click on the My Computer icon (right at the beginning of the registry)
And select EXPORT. Give the exported registry file a realistic name to save.}

Cheers, Babe.

The Windows XP Recovery Console
What do you do if you can't start Windows in normal or Safe Mode or System Restore is out of the question? You may be able to get back to work by using the Recovery Console, a stripped-down command-line environment that provides a limited set of tools to diagnose and repair problems.

The advantage of the Recovery Console over Safe Mode is that it works even when your Windows
system files are corrupted. The following tasks can be performed using the Recovery Console:
* Use, copy, rename, or replace Windows system files and folders
* Enable or disable services or devices (changes take effect on the next time boot)
* Repair the file system boot sector or the Master Boot Record (MBR)
* Rebuild or repair the Windows boot menu
* Create and format drives
Starting the Recovery Console from the Windows CD
1. Insert the Windows CD and restart your computer.
Follow your computer's prompts to start from the CD.
2. Follow the setup prompts to load the basic Windows startup files.
At the "Welcome To Setup" screen, press R to start the Recovery Console.
3. If you have multiple options on the Windows startup menu, enter the number
of the Windows installation you want to access from the Recovery Console.
* Do NOT use the Windows XP Recovery Console to attempt repairs of other Windows versions.
* If you have only a single Windows installation to choose from, you might be tempted to
just press Enter. DON'T. You must type the number of the Windows installation to start
the Recovery Console. If you press Enter, Windows restarts.

4. When prompted, type the Administrator password. If you're using the Recovery Console on a
system running Windows XP Home Edition, this password is blank by default, so just press Enter.
5. At the command prompt, enter Recovery Console commands directly.
6. To quit the Recovery Console and restart the computer, use the Exit command.
Adding the Recovery Console to the Startup Menu
Although you can run the Recovery Console by booting directly from the Windows XP CD, it's more convenient to set it up as a startup option on the boot menu. To do so follow these steps:
1. Insert the Windows XP CD into your drive.
2. At a command prompt, type d:\i386\winnt32.exe /cmdcons
(replacing d with the letter of your CD drive).
A Windows Setup message appears, describing the Recovery Console option.
3. Click Yes to install the console.
The next time you start your computer, you'll see a "Microsoft Windows Recovery Console" entry on the boot menu.

If you decide for whatever reason that you no longer want the Recovery Console on the boot menu, follow these steps to remove it:
1. Edit the Boot.ini file to remove the Recovery Console entry. The entry should look like:
C:\cmdcons\bootsect.dat="Microsoft Windows Recovery Console" /cmdcons
2. Open Windows Explorer, browse to the root directory of the drive specified
in the Boot.ini entry for Recovery Console, and then delete the Cmdcons folder.
(Because this is a hidden system folder, you might need to adjust folder options
to make it visible)
3. In the root directory, delete the file Cmldr.
Removing the Recovery Console will recover about 7 MB of disk space.

Recovery Console Restrictions
Although the Recovery Console prompt looks identical to the command prompt that you're familiar with from MS-DOS or the Windows XP command interpreter (Cmd.exe), it's NOT the same. After logging on to the Recovery Console, your actions are severely limited. You may access files only in the following locations:
* The root directory of any volume.
* The %SystemRoot% folder and subfolders of the selected Windows XP installation.
{Note: On a typical clean setup or an upgrade from Windows 98 or Windows Me,
this is usually C:\Windows}.
* The Recovery Console Cmdcons folder and any subfolders (if you installed the
Recovery Console as a startup option).
* Files and folders on removable disks, including floppy disks, CDs, and Zip disks.

In addition to these security-based restrictions, technical limitations impose additional restrictions on Windows XP Professional systems that use dynamic disks. If your system is configured with one or more dynamic disks, see the Microsoft Knowledge Base article 227364, "Dynamic Volumes Are Not Displayed Accurately in Text-Mode Setup or Recovery Console".
If the Recovery Console allowed unlimited access to files and folders on your hard disk, it would pose a serious security hole, especially on systems running Windows XP Home Edition, where the Administrator password is blank. To prevent unauthorised access, 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. Specifically, 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 on
NTFS and FAT32 volumes alike.
* Write access to removable disks is disabled. 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.
In fact, if you use Windows XP Home Edition you have to jump through several hoops to
add a password to the local Administrator account at all.
* No text editing tools are available in the Recovery Console.
Using Recovery Console Commands
After you've logged on to Recovery Console, you can type help to see a list of all available commands. Type help commandname or use the /? switch after a command name to learn its syntax. Although many of Recovery Console's commands are similar to those used in the Windows XP command interpreter (Cmd.exe) and its MS-DOS predecessor (Command.com), the Recovery Console versions of each command typically offer fewer options (switches). Also, unless you tweak the Recovery Console environment as discussed later, these commands do not accept wildcard specifications.
The following table shows the commands available from the Recovery Console prompt.
Command Description
======= ===========
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 entries in the operating system menu (Boot.ini)

Cd or Chdir Changes folders

Chkdsk Checks and, if needed, repairs or recovers a drive; marks bad sectors and
recovers readable information; 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 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; note that this command is
not the same as the one available at a normal command prompt and
should not be used 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 you specify

Fixmbr Repairs the Master Boot Record of the specified disk, usually the system
partition. Format Formats a primary partition, volume, or logical drive
using the file system you specify

Help Displays a list of all available commands

Listsvc Lists all available services and drivers and their current start types

Logon Lists all detected installations of Windows XP, Windows 2000, and Windows
NT and allows you to choose which installation you want to log on to; if
you type an incorrect password three times, the system restarts

Map Lists drive letters, file system types, partition sizes, and mappings to
physical devices; 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 screenful; 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 folders

Ren or Rename Renames a file

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
Customising the Recovery Console
With a little advance preparation, you can overcome at least some of the Recovery Console limitations listed here when running Windows XP Professional (this will NOT work with Home Edition). You need to use the Set command to change system variables in the Recovery Console environment. By default, the Set command is disabled. To enable it, you must change system settings using the Group Policy tool. After logging on as an administrator, follow these steps:
* From any command prompt, type gpedit.msc to open the Group Policy editor.
* In the console pane at the left, expand Local Computer Policy, and then expand
Computer Configuration, Windows Settings, Security Settings, and Local Policies.
* Select Security Options from the console pane on the left.
* In the list of policies on the right, double-click the entry for Recovery Console:
"Allow Floppy Copy And Access To All Drives And All Folders".
* Select the Enabled option and then click OK.
After enabling this policy, you can start the Recovery Console, log on with the local Administrator password, and use any of the following commands to expand your capabilities: Note that the space around the equal signs is required. (To see the current settings for all four parameters, type set and press Enter.)
Set allowwildcards = true Allows you to use the * and ? wildcards with Recovery Console commands.
Set allowallpaths = true Permits you to use the Cd command to list files and subfolders in all
folders on all local disks.
Set allowremovablemedia = true Allows you to copy files from local drives to removable media.
Set nocopyprompt = true Eliminates the warning message that appears when you copy one or more
files that overwrite existing files using Recovery Console commands.
Repairing Damaged Boot Files
The most common cause of problems with boot files is the improper use of third-party disk utilities or failed attempts to create multi-boot systems. If the setup program for another operating system is incompatible with Windows XP, it can overwrite or damage essential startup files. The following repair techniques are available from the Recovery Console for some common problems:

1. The Boot.ini file is corrupt or missing
From the Recovery Console, type bootcfg /scan to list all available Windows installations on all available disks. Use bootcfg /rebuild to automatically replace the existing Boot.ini file; use bootcfg /add to append a Windows installation to Boot.ini without changing existing entries.

2. 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 and enter the source and destination; Windows expands compressed files automatically. If the file is stored within a .cab file, such as Driver.cab, use the Expand command.

3. Another operating system replaced the Windows XP boot sector code
Start Recovery Console from the Windows CD and use the Fixboot command to rewrite the boot sector code. Restart your computer.

Enabling and Disabling Services and Drivers
If you suspect that a hardware driver or a service such as an antivirus scanner or a remote-control utility is causing your problems and you can't start Windows even in Safe Mode, use the following Recovery Console options to identify the offending service and enable or disable it:

Listsvc This command displays a complete list of all services and drivers on your system,
along with their current status and any optional comments.
This is a long list and not exactly packed with helpful information. You might need to
scroll through many screens and look carefully to identify the driver or service in question.

Disable Use this command followed by the name of the service or driver you want to stop and
press Enter. The Disable command sets the start type of the service to SERVICE_DISABLED.
Before doing so, it displays the current start type value of the service: SERVICE_BOOT_START,
so that you can re-enable the device or service properly if necessary.

Enable If after troubleshooting you determine that the device you disabled is not causing your
problem, use this command, followed by the service or device name and the start type value
you noted when you disabled the service or device.