|
Langa Letter:
The OS Inside The OS By Fred Langa, April 30, 2006 (12:00 AM EDT) <http://www.techweb.com/wire/187000225> Windows XP's Recovery Console is a very restricted version of XP that's been stripped to its barest fundamentals--it's got just enough to get the operating system going, with none of the usual bells and whistles. This skeletal version of the operating system is intended to effect repairs and perform low-level maintenance, and for those purposes it's a very good tool. But it's also very limited. By default, it restricts you to working in just a few systems folders, refusing you access to any other part of your hard drive. It prevents you from using "wildcards" (such as "*.exe" to represent all files ending in "exe"). It won't let you copy files to removable media such as floppies. And you're always prompted when overwriting each and any file. Fortunately, a simple tweak that can be performed in under a minute removes all those restrictions and frees up Recovery Console to let you work anywhere on the hard drive, access and use removable media such as floppies, use wildcards to work on large groups of files or folders at once, and skip the overwrite warnings if you so choose. With this tweak, Recovery Console becomes, in effect, a general-purpose XP DOS, serving much the same function as did DOS boot floppies for earlier versions of Windows. With the Recovery Console's limitations removed, you can then access any file or folder anywhere on your hard drive and run any of the following commands:
So you see, with this tweak, the Recovery Console really does become a kind of lightweight XP DOS--a much more powerful, all-purpose mini-operating system, making it enormously more useful than otherwise. RECOVERY CONSOLE'S RESTRICTIONS The idea behind Recovery Console's restrictions is safety. By default, Recovery Console forces you to work slowly (basically one file or folder at a time) and prevents accidental overwrites by making you confirm each one. And by preventing floppy access and limiting where you can go on the hard drive, Recovery Console's restrictions make it a little harder for an unskilled or unauthorized person to move user data files off the system. But sometimes those protections are counterproductive. For example, if you're trying to pull a critical data file off a crashed system, the Recovery Console's default settings get in the way. You can't get to the Documents and Settings folder at all, and even if you could you wouldn't be able to copy the files you need to a floppy. The Recovery Console's restrictions can also actually hinder other repair work by making mass deletions or overwrites a very laborious one-at-a-time thing. Many IT staffers and power users now simply sidestep the Recovery Console's prohibitions by booting to a specially configured XP repair CD, or to XP or Linux on a USB flash drive. (See "A Must-Have Repair And Recovery Tool" <http://www.informationweek.com/showArticle.jhtml?articleID=167100904>; "XP On Your Thumb Drive" <http://www.informationweek.com/showArticle.jhtml;?articleID=177102101>; "Solving USB Boot Problems" <http://www.informationweek.com/hardware/showArticle.jhtml?articleID=28700158>; and info on the free and excellent Puppy Linux: <http://www.informationweek.com/LP/showArticle.jhtml?articleID=183702383&pgno=6>.) Booting to an alternate operating system works, but isn't terribly convenient just to do some basic, DOS-like work such as make file copies or deletions. It's much nicer simply to remove Recovery Console's arbitrary restrictions and thus prevent the need to use external tools and operating systems for DOS-like maintenance, repair, and recovery work. SETTING IT UP Of course, before you can tweak the Recovery Console, you have to install it. We've covered the Recovery Console thoroughly in the past (see <http://www.google.com/search?hl=en&lr=&safe=off&q=%22recovery+console%22+langa+site%3Ainformationweek.com> and <http://www.google.com/search?as_q=%22recovery+console%22&as_sitesearch=langa.com>). So for the rest of this article, we'll assume your target PC has the Recovery Console installed on the hard drive. If you need further help on getting it set up, see "Description of the Windows XP Recovery Console" <http://support.microsoft.com/?kbid=314058> and "How to install and use the Recovery Console in Windows XP" <http://support.microsoft.com/?kbid=307654>. Now to get us all on the same page, let's take a quick look at the Recovery Console's default behavior. If you want to follow along on your own PC, reboot, select the Recovery Console, and log in if required to do so. Switch to the root directory (type "CD \" without the quotes and hit enter); Recovery Console should allow this. But now try switching to, say, the Documents and Settings folder and see what happens: You can't. As shown in Screen 1, you simply get an "access is denied" message, with no further explanation. By default, the Recovery Console is very limited, with severe restrictions on where you can go on the hard drive and what you can do. For example, you can't even access the Documents and Settings folder. ![]() Screen One By default, the Recovery Console is very limited, with severe restrictions on where you can go on the hard drive and what you can do. For example, you can't even access the Documents and Settings folder. If you try the built-in documentation to resolve the "access is denied" message, you'll find that Microsoft has left a number of unfinished areas and rough spots in Recovery Console. (Don't worry-- we'll show you how to avoid them.) For example, unrestricted access to the hard drive is controlled by a variable called "AllowAllPaths." In XP (just as in the days of DOS), "environmental variables" like these are controlled via the SET command. According to Microsoft's documentation on the Recovery Console, all you have to do is type: SET AllowAllPaths = TRUE and you'll be able to navigate anywhere on your hard drive. Sounds great! Let's try it. ![]() Screen Two Following Microsoft's instructions on overcoming Recovery Console's limitations can lead to initial failures, with error messages telling you additional prep work is needed. Following Microsoft's instructions on overcoming Recovery Console's limitations can lead to initial failures, with error messages telling you additional prep work is needed. Unfortunately, as shown in Screen 2, the SET command doesn't work. Unless you've already performed a necessary prior tweak, all you'll get is an error message: The SET command is currently disabled. The SET command is an optional Recovery console command that can only be enabled by using the the Security Configuration and Analysis snap-in. Note the typo in the error message--the repeated word "the" (as in "...the the Security Configuration..."). That, plus Microsoft's failure to mention the necessary tweak beforehand, plus the fact that the error message is wrong (there's a much easier way to enable the SET command), very strongly suggests to me that we're in an unpolished, only roughly finished area of the Recovery Console. Things don't get much better if you pursue the built-in help further. Normally, you can get assistance for any command by typing the command followed by " /?" as shown in Screen 3. Before we were told to use ''the the Security Configuration and Analysis snap-in'' (see Screen 2), and now we're told to use the ''Group Policy snap-in'' with no further explanation. But don't worry, we'll show you the right (and much easier) way in a moment. ![]() Screen Three Before we were told to use "the the Security Configuration and Analysis snap-in" (see Screen 2), and now we're told to use the "Group Policy snap-in" with no further explanation. But don't worry, we'll show you the right (and much easier) way in a moment. The query doesn't do much in this instance. Typing "SET ?/" lists the commands that aren't yet available to you, plus one new bit of information: "The SET command is an optional Recovery Console command that can only be enabled by using the Group Policy snap-in." No further information is provided. OK, let's quickly review: Microsoft has told us to use the SET command, and in trying that we're informed that before SET will work, we have to use either "the the Security Configuration and Analysis snap-in" and/or the "Group Policy snap-in." Confused yet? (I was, when I first encountered this.) But hold on--we're just about done with the confusion and ready to show you the simple, straightforward way of getting SET to work. But first, there's one more bit of Microsoftian fumbling: If you go hunting for information in the Microsoft Knowledge Base, you'll find "How to add more power to Recovery Console by using Group Policy in Windows XP Professional" <http://support.microsoft.com/default.aspx?scid=kb;en-us;310497>, but that too turns out to be a disappointment. While that document will indeed show you how to enable the SET command in Recovery Console, it does so with a lot of needless complexity. In fact, Microsoft's documentation blows right past the much easier method, which I find simpler and faster. Here it is: 1) Start the Registry Editor (click Start/Run and type "REGEDIT" in the Run box). 2) Click your way down the HKEY_LOCAL_MACHINE tree to: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Setup\RecoveryConsole 3) Double-click on "SetCommand" in the right-hand pane and type the numeral "1" in the "value data" box that will open. (See Screen 4.) ![]() Screen Four All it really takes to remove the restrictions in Recovery Console is to change this "value data" from the default zero to one. That's it--you're done! (See text for more detail.) All it really takes to remove the restrictions in Recovery Console is to change this That's it. Exit Regedit, and you're done. No muss, no fuss, no weird gyrations. Just those three quick steps, and you're finished. Now when you enter the Recovery Console, the SET command will work. It's that simple--although Microsoft's convoluted, contradictory instructions sure make it seem harder. USING SET After you've applied the tweak above and are back in the Recovery Console at a command prompt, the format for using SET is: SET [variable] = [TRUE/FALSE] In other words, you type SET, then a space, then the variable you want to modify, followed by a space, then an equal sign and another space, and then the word "TRUE" if you want to enable the variable, or "FALSE" to disable it. Here are the options you can choose: SET AllowAllPaths = TRUE This allows you to access all directories and subdirectories on a hard drive. SET AllowRemovableMedia = TRUE This allows you to access removable media (such as a floppy) as a target for copied files. SET AllowWildCards = TRUE This enables wildcard support (e.g. using an asterisk to match any/all files) so you can use commands such as COPY and DEL on whole groups of files and folders. SET NoCopyPrompt = TRUE This turns off confirmation when overwriting an existing file, which is useful when copying many files into an already populated folder. You can SET these variables one by one, in any combination of TRUE and FALSE. (They're all FALSE--disabled--by default.) You can also just type the word SET by itself, with no parameters, to see what the current variable assignments are. REAL-LIFE EXAMPLE Screen 5 shows how simply this works in real life. After our quick, three-step tweak above, the Recovery Console now accepts a "SET AllowAllPaths = TRUE" without complaint. With the simple, three-step tweak done, the Recovery Console now accepts the SET commands without trouble.
Screen Five With the simple, three-step tweak done, the Recovery Console now accepts the SET commands without trouble. And now, as Screen 6 shows, you can change to other directories and folders at will. We have no trouble at all getting to the Documents and Settings folder--no more "access is denied" message. In fact, we can now navigate anywhere we want on the hard drive and use the full range of Recovery Console's commands, as listed above. ![]() Screen Six Where before we got an "access is denied" message, now we can access Documents and Settings (or any other folder) at will. Recovery Console's restrictions are gone! So Microsoft may have left rough edges in the Recovery Console, and its usage instructions may be needlessly convoluted and even contradictory, but now you know the easy, fast way to enable what amounts to a full XP DOS within the Recovery Console, with all the power and flexibility that implies! Copyright © 2003 CMP Media, LLC |