How to use the Windows XP Recovery Console

Discussion in 'Windows Desktop Systems' started by NetRyder, Jan 13, 2004.

  1. NetRyder

    NetRyder Tech Junkie Folding Team

    Messages:
    13,256
    Location:
    New York City
    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.
     
  2. NetRyder

    NetRyder Tech Junkie Folding Team

    Messages:
    13,256
    Location:
    New York City
    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...
     
  3. Grandmaster

    Grandmaster Electronica Addict Political User Folding Team

    Messages:
    10,574
    Location:
    Santa Clara, CA
    Excellent post. Should help out a lot of people.
     
    punkandacoke likes this.
  4. Perris Calderon

    Perris Calderon Moderator Staff Member Political User

    Messages:
    12,332
    Location:
    new york
    great job netryder

    those of you with hands on experience, anything to add, feel free to contrubute
     
    punkandacoke likes this.
  5. NetRyder

    NetRyder Tech Junkie Folding Team

    Messages:
    13,256
    Location:
    New York City
    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.
     
  6. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
    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
     
    NetRyder likes this.
  7. madhon

    madhon OSNN Junior Addict

    Messages:
    45
    Location:
    South Wales, UK
    barts pe builder can do the same as recovery console and a whole lot more..
    PE Builder
     
  8. NetRyder

    NetRyder Tech Junkie Folding Team

    Messages:
    13,256
    Location:
    New York City
    Nice one, j79zlr. I missed that. :)
     
  9. onimkron

    onimkron OSNN Senior Addict

    Messages:
    414
    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).
     
  10. NetRyder

    NetRyder Tech Junkie Folding Team

    Messages:
    13,256
    Location:
    New York City
    Glad to know the guide's coming in handy :)
     
  11. Terrahertz

    Terrahertz Extinction Agenda Political User Folding Team

    Messages:
    972
    Location:
    New York
    Thanks for the post NetRyder much appreciated.
     
  12. dick471

    dick471 OSNN Junior Addict

    Messages:
    47
    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.
     
  13. Xie

    Xie - geek - Subscribed User Folding Team

    Messages:
    5,275
    Location:
    NY, USA
    Might have to test this later ... system has upset me today so ... ::devil::
     
  14. Zooker

    Zooker OSNN Addict

    Messages:
    217
    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! :)
     
  15. Electronic Punk

    Electronic Punk Administrator Staff Member Political User Folding Team

    Messages:
    18,590
    Location:
    Copenhagen, Denmark
    welcome back Zooker :)
     
  16. NetRyder

    NetRyder Tech Junkie Folding Team

    Messages:
    13,256
    Location:
    New York City
    Hehe, yeah...the recovery console can be a life-saver in certain situations. Glad you found the guide useful [​IMG]
    And like EP said, welcome back!
     
  17. ~bk

    ~bk I Political User

    Messages:
    3,768
    Location:
    Canada
    Nice one. [​IMG]
     
  18. rushm001

    rushm001 In the beginning...... Political User

    Messages:
    3,480
    Location:
    Norfolk, UK
    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
     
  19. radrickdavsi

    radrickdavsi OSNN One Post Wonder

    Messages:
    2
    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?
     
  20. cpugeniusmv

    cpugeniusmv Computer Genius

    Messages:
    485
    did you try entering a blank password in the recovery console?