Back in the Windows 9x days, it was often easier (and faster) to simply reinstall Windows on a non-booting computer than to actually diagnose the problem. Corporate IT departments still do this to a large degree – after all, it’s usually cheaper to just re-image an employee’s desktop than to pay an IT guy four hours of labor to troubleshoot some arcane issue. But for many home users it’s just not an option. Reinstalling XP itself doesn’t take that much time; installing the dozens of programs and “system tweaks” does.
Thankfully, Windows XP is pretty bulletproof; aside from basic “newbie problems” and self-inflicted issues (like spyware), you really have to work hard to take down an XP machine. But it does happen – in fact, it happened to me twice in just the past week! I decided to play around with various flavors of Linux. I decided to try the most “user friendly” version, Ubuntu, first. After playing around with the “live CD” version of the operating system, I decided to actually install it on my hard drive. Which was easy… but the Ubuntu installer overwrote the Master Boot Record (MBR) on my hard drive and Windows wouldn’t start (Ironically, in an effort to make Linux “easier” to use, they apparently removed the option not to install a bootloader… which made it impossible to boot into Windows!).
A few days later, I decided to install the latest beta of Windows Vista. That was much smoother than the Ubuntu install; however at one point Vista gave me a barrage of pop-ups that said my hard disk was corrupt. Sure enough, when I ran CHKDSK on the Vista drive, the app reported hundreds of errors. Thinking my hard drive might be failing, I rebooted into XP and set CHKDSK to run on the rest of my drives at the next boot. CHKDSK ran at the next boot, found no errors and rebooted… only to run CHKDSK again and reboot… only to run CHKDSK again and reboot… I had somehow gotten stuck in a “CHKDSK loop” with no easy way out of it.
Except that I had planned ahead. Windows XP comes with a lifesaving tool called the Recovery Console. If your system refuses to boot, you can boot to the console and use several of the recovery tools Microsoft provides to fix it. In the case of the hootched MBR, I used the BOOTCFG command to add a new entry to the BOOT.INI file which pointed to the correct XP partition on my drive. Once I rebooted back into XP, I updated the BOOT.INI file with the new partition information and deleted the entry that BOOTCFG had created. I was back in business in minutes!
For the “CHKDSK loop” problem, I booted into the console and navigated to Window’s System32 directory. I then renamed AUTOCHK.EXE to OLDAUTOCHK.EXE. This prevented CHKDSK from running at boot-up and killed the loop; once I was back in XP I was able to fire up the registry editor and go to HKLM\System\CurrentControlSet\Control\Session Manager and delete the entries from the BootExecute key that were causing XP to get stuck in the loop (if you’re interested, delete any reference to AUTOCHK in the key except for autocheck autochk *).
One thing I wanted to mention – actually, the main reason I wrote this entry in the first place – was that although many folks use the Recovery Console by booting off the XP CD, you can also install the console onto your hard drive for easy access in the future. I did this long ago, and thus I didn’t have to look in the bottom of my closet for the XP CD when I needed the Recovery Console. To install it, just pop the XP CD into your CD\DVD drive and type
x:\i386\winnt32.exe /cmdcons
into the “Run:” box, where x is the letter of your CD-ROM drive. You’ll be presented with a mini-setup routine. When that’s completed, you’ll have a new entry in your XP boot menu. When you need to get into the Recovery Console, just select it at the boot menu and enter the local Administrator password when prompted.