How to use the Windows XP Recovery Console

NetRyder

Tech Junkie
Joined
Apr 19, 2002
Messages
13,256
#1
There is a common misconception that NTFS volumes cannot be accessed from the command line, and that you're in a mess if you can't boot into XP.
This is not true. The Windows XP Recovery Console can be used to modify files from the command line if you can't boot into Windows, even on NTFS partitions. This guide describes how the Recovery Console can be used.

What can you do from the Recovery Console?
You can enable and disable services, format drives, repair the boot record, read and write data on a local drive (including drives that are formatted to use the NT File System (NTFS), and perform many other administrative tasks.

NOTE: By default, the Recovery Console allows you to access only the root folder, the WINDOWS folder (and it's subfolders), and removable drives such as the CD-ROM. Also, it will not allow you to copy files to removable media such as floppies. However, you can make some changes that will allow you to access all folders on your drives, as well as copy files to removable media. Follow the steps below:

Allow Access to all folders and removable media:
1. Click Start, click Run, type mmc in the Open box, and then click OK.
2. On the File menu, click Add/Remove Snap-in, and then click Add.
3. Click Group Policy, and then click Add.
4. Click Local Computer, click Finish, and then click Close to return to the Add/Remove Snap-in dialog box.
5. Click OK to return to the Console window.
6. Expand the Local Computer Policy object to Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options.
7. Select the Security Options object in the Console pane to display the security policies in the Details pane.
8. In the Details pane, double-click the Recovery Console: Allow Floppy Copy And Access To All Drives And Folders policy.
9. Click Enabled, and then click OK.

How to get into the Recovery Console:
1. Insert the Windows XP CD-ROM into the CD-ROM drive, and then restart the computer. Click to select any options that are required to start the computer from the CD-ROM drive if you are prompted to do so.
2. When the "Welcome to Setup" screen appears, press R to start the Recovery Console.
3. When the Recovery Console menu is displayed, a numbered list of the Windows installations on the computer is displayed (usually only one entry-c:\Windows-exists). Press a number before you press ENTER, even when only one entry appears. If you press ENTER without choosing a number, the computer restarts and begins the process again.
4. When you are prompted to do so, type the Administrator password. If the administrator password is blank, just press ENTER.

If you followed the steps above to allow access to all folders and removable media, you need to perform one extra step. At the command prompt type:
set AllowAllPaths = TRUE
set AllowRemovableMedia = TRUE
set AllowWildCards = TRUE

Make sure there is a space before and after the = sign, or you will encounter a syntax error!

List of commands that can be used in the Console:
For a list of commands that are available in Recovery Console, type help at the command prompt, and then press ENTER.
For information about a specific command, type help <commandname> at the command prompt, and then press ENTER.

Here's a list of commands that can be used:
* Attrib changes attributes on one file or subdirectory.
* Batch executes commands that you specify in the text file, Inputfile; Outputfile holds the output of the commands. If you omit the Outputfile parameter, output is displayed on the screen.
* Bootcfg is used to manipulate the Boot.ini for boot configuration and recovery.
* CD (Chdir) operates only within the system directories of the current Windows installation, removable media, the root directory of any hard disk partition, or the local installation sources.
* Chkdsk The /p switch runs Chkdsk even if the drive is not flagged as dirty. The /r switch locates bad sectors and recovers readable information; this switch implies /p. Chkdsk requires Autochk. Chkdsk automatically looks for Autochk.exe in the startup (or boot) folder. If Chkdsk cannot find the file in the startup folder, it looks for the Windows 2000 Setup CD-ROM. If Chkdsk cannot find the installation CD-ROM, it prompts the user for the location of Autochk.exe.
* Cls clears the screen.
* Copy copies one file to a target location. By default, the target cannot be removable media and you cannot use wildcards. Copying a compressed file from the Windows 2000 Setup CD-ROM automatically decompresses the file.
* Del (Delete) deletes one file. Operates within the system directories of the current Windows installation, removable media, the root directory of any hard disk partition, or the local installation sources. You cannot use wildcards by default.
* Dir displays a list of all files, including hidden and system files.
* Disable disables a Windows system service or driver. The variable service_or_driver is the name of the service or driver that you want to disable. When you use this command to disable a service, it displays the service's original startup type before changing the type to SERVICE_DISABLED. You should note the original startup type so that you can use the enable command to restart the service.
* Diskpart manages partitions on hard disk volumes. The /add option creates a new partition; the /delete option deletes an existing partition. The variable device is the device name for a new partition (such as \device\harddisk0). The variable drive is the drive letter for a partition that you are deleting (for example, D); partition is the partition-based name for a partition that you are deleting, (for example: \device\harddisk0\partition1) and can be used in place of the drive variable. The variable size is the size, in megabytes, of a new partition.
* Enable enables a Windows system service or driver.
* Fixboot writes a new boot sector on the system partition.
* Fixmbr repairs the boot partition's master boot code. The variable device is an optional name that specifies the device that needs a new MBR; omit this variable when the target is the boot device.
* Format formats a disk. The /q switch performs a quick format; the /fs switch specifies the file system.
* Help If you do not use the command variable to specify a command, help lists all the commands that the Recovery Console supports.
* Listsvc displays all available services and drivers on the computer.
* Logon displays detected installations of Windows and requests the local Administrator password for those installations. Use this command to move to another installation or subdirectory.
* Map displays currently active device mappings. Include the arc option to specify the use of Advanced RISC Computing (ARC) paths (the format for Boot.ini) instead of Windows device paths.
* MD (Mkdir) operates only within the system directories of the current Windows installation, removable media, the root directory of any hard disk partition, or the local installation sources.
* More (or Type) displays the specified text file (such as, filename) on screen.
* Net Use connects to a remote share for the Windows XP Recovery Console.
* Rd (Rmdir) operates only within the system directories of the current Windows installation, removable media, the root directory of any hard disk partition, or the local installation sources.
* Ren (Rename) operates only within the system directories of the current Windows installation, removable media, the root directory of any hard disk partition, or the local installation sources. You cannot specify a new drive or path as the target.
* Set displays and sets the Recovery Console environment variables.
* Systemroot sets the current directory to %SystemRoot%.

Sources: Microsoft Knowledge Base articles and other websites.
 

NetRyder

Tech Junkie
Joined
Apr 19, 2002
Messages
13,256
#2
Thanks to Perris for the reminder, and to [e]-punk for salvaging my old post from what was left of the vB2 database. :)
So here it is again...
 

NetRyder

Tech Junkie
Joined
Apr 19, 2002
Messages
13,256
#5
Since XP Home does not include the Group Policy Editor (gpedit.msc), you need to edit the following registry key in order to enable "Allow Floppy Copy And Access To All Drives And Folders"

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SeCEdit\Reg Values\MACHINE/Software/Microsoft/Windows NT/CurrentVersion/Setup/RecoveryConsole/SetCommand

Change ValueType to 2.
 

j79zlr

Glaanies script monkey
Political User
Joined
Feb 16, 2003
Messages
2,725
#6
Dont forget that the SET command is disabled in XP home, so you need to change SetCommand from 0 to 1 in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Setup\RecoveryConsole


then you can access floppy drives with

set AllowRemovableMedia = true
 

onimkron

OSNN Senior Addict
Joined
Jan 17, 2004
Messages
414
#9
Many thanks for this. I had a problem with a corrupted file the other day, and I reckon using the recovery concole would've saved some time (and hassle).
 

dick471

OSNN Junior Addict
Joined
Sep 9, 2002
Messages
47
#12
NetRyder: Thanks for the article. I can't find much that ($) NTFSDosPro can do that can't be done with RC. FYI this also works in W2000, W2000 Server, and W2003 Server. To allow access to all folders and removable media is a little different than your article, but anyone who needs this in these operating systems will figure how to implement.
 

Zooker

OSNN Addict
Joined
Jun 8, 2002
Messages
217
#14
Thanks NetRyder!! Good grief I sure could have used that info about a month ago when I went to XP heck and back, this is good stuff and I printed and saved it in my desk drawer. Thanks again! :)
 

NetRyder

Tech Junkie
Joined
Apr 19, 2002
Messages
13,256
#16
Zooker said:
Thanks NetRyder!! Good grief I sure could have used that info about a month ago when I went to XP heck and back, this is good stuff and I printed and saved it in my desk drawer. Thanks again! :)
Hehe, yeah...the recovery console can be a life-saver in certain situations. Glad you found the guide useful

And like EP said, welcome back!
 

rushm001

In the beginning......
Political User
Joined
Sep 21, 2002
Messages
3,484
#18
You can install the recovery console onto the startup menu.

Click Start, click Run, and then type CD-ROM drive letter:\i386\winnt32.exe /cmdcons in the Open box, where CD-ROM drive letter is the drive letter assigned to your CD-ROM drive.

Click OK, follow the instructions on the screen to finish Setup, and then restart your computer.

Edit: How to remove it can be found here
 
Joined
Jul 8, 2004
Messages
2
#19
I'm having trouble figuring out my own Admin password so I can run the Windows Recovery Console. I'm running Windows XP Home.

The first thing I tried was going to my control panel, user settings, and I updated my password for my main login account, which has admin priviledges. I rebooted and tried logging into the Recovery Console, and no luck with the new password.

Then I tried rebooting in safe mode, and I updated the password setting on the default named Administrator account. Reboot. The Recovery Console still doesn't like the password.

???

Any idea what I should try?
 

Members online

No members online now.

Latest posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
62,000
Messages
673,428
Members
89,026
Latest member
xtr14testro