Tech Line

LKGC Testing Trouble

To get some practice recovering a downed computer, you need one that can be broken at will. Here's a scriptable way to do that.

Chris, I’m relative new to IT training and would like to take my classes a little further. When I teach Windows startup recovery, I just discuss the options. I'd like to break Windows XP so that my students can recover using Last Known Good Configuration. I have installed improper drivers on student systems in the past, but this takes awhile. Is there an easier way to break the XP startup?
— Jeff

Tech Help—Just An
E-Mail Away

Got a Windows, Exchange or virtualization question or need troubleshooting help? Or maybe you want a better explanation than provided in the manuals? Describe your dilemma in an e-mail to the MCPmag.com editors at mailto:editor@mcpmag.com; the best questions get answered in this column and garner the questioner with a nifty MCPmag.com baseball-style cap.

When you send your questions, please include your full first and last name, location, certifications (if any) with your message. (If you prefer to remain anonymous, specify this in your message, but submit the requested information for verification purposes.)

Jeff, I must admit that it’s nice to finally be asked to break something in this column! To be honest, I feel like an auto body technician at a demolition derby. So sure, I would love to help you here.

An easy way to break Windows startup is to change a needed driver file reference in the Registry. Making the change in the Current Control Set portion of the Registry will ensure that the inserted problem can be recovered using LKGC.

With XP, one of the easiest ways to automate a Registry change is by using the reg.exe command. Here's an example using reg.exe to change the value of the ATAPI driver file in the Registry:

reg add HKLM\System\CurrentControlSet\Services\atapi /v ImagePath /t REG_SZ /d System32\DRIVERS\atapi1.sys /f

In the command, you need the /v switch to specify the Registry value to modify. The /t switch then indicates the value type. The /d switch allows you to define the new data for the Registry value. Finally, the /f switch tells the command to overwrite the existing data.

To automate the command, just enter it in a text editor such as Notepad and save it as a batch file (.bat). Now you can just have your students access the batch file over the network and double-click on it to add the registry change.

When the system reboots, they’ll be greeted with the infamous blue screen of death accompanied by the stop error code 0x0000007B. Following the subsequent BSOD, Windows will again reboot and present the Windows Startup Menu. Selecting the Last Known Good Configuration option will correct the error. If the menu does not appear, press F8 as soon as Windows starts.

If you want to automate the system shutdown in the batch file, you could also include the shutdown.exe command. Here's a sample of the command that you could use:

shutdown -r -t 10 -c "Your system is about to shut down. Fool!"

In this command, the -r parameter tells shutdown to reboot the system. The -t parameter specifies the number of seconds to wait before the shutdown occurs. The -c parameter allows you to insert a comment in the Shutdown dialog box that will appear once the command executes. I recently saw a few A-Team reruns, so I was feeling a little "Mr. T" today. Needless to say, you may want to edit my sample comment for your purposes.

When contacted about contributing to this article, Mr. T offered "I don't think so, sucka!" Even without Mr. T’s help, hopefully this solution will solve your problem.

About the Author

Chris Wolf is a Microsoft MVP for Windows --Virtual Machine and is a MCSE, MCT, and CCNA. He's a Senior Analyst for Burton Group who specializes in the areas of virtualization solutions, high availability, storage and enterprise management. Chris is the author of Virtualization: From the Desktop to the Enterprise (Apress), Troubleshooting Microsoft Technologies (Addison Wesley), and a contributor to the Windows Server 2003 Deployment Kit (Microsoft Press).learningstore-20/">Troubleshooting Microsoft Technologies (Addison Wesley) and a contributor to the Windows Server 2003 Deployment Kit (Microsoft Press).

comments powered by Disqus

SharePoint Watch

Sign up for our newsletter.

I agree to this site's Privacy Policy.