How can I update the \%systemroot%\repair folder under Windows XP and Windows 2000?

John Savill

April 3, 2002

2 Min Read
ITPro Today logo in a gray background | ITPro Today

A. Microsoft has removed the Rdisk utility from XP and Win2K, thereby eliminating your ability to create an Emergency Repair Disk (ERD) for recovering the OS in case of a system crash. As part of the emergency repair process, the OS would update the %systemroot%repair folder, which contains backups of core registry values. To update the %systemroot%repair folder in XP and Win2K, you must back up the necessary system-state files and ensure that you've selected the proper system state during the backup.

I've created a script that starts the backup application, selects the current system state, and stops the backup process. This series of steps updates the repair folder, and the backup comes in handy when you need to restore a system to a specific system state. You might need to edit some of the sleep times in the script if you experience problems when you run it (e.g., your machine is slow and doesn't finish a certain task before the script attempts the next step). Also, the script assumes that File is the default backup media.

I provide this script as-is--I can't provide technical assistance for tweaking the settings for your environment. I recommend that only advanced users apply this script.

   Rem RDISK.VBS   Rem Update %systemroot%Repair folder    Rem Copyright 2002 John Savill, [email protected]    Rem This script may be distributed freely but must not be edited including this notice   set WshShell = CreateObject("WScript.Shell")   dim deleteFile, filesys, fileToDelete   set filesys = CreateObject ("Scripting.FileSystemObject")   fileToDelete= WshShell.ExpandEnvironmentStrings("%systemroot%") &    "tempbackup.bkf"   Wshshell.Run "%systemroot%system32tbackup.exe"   WScript.Sleep 5000   Wshshell.Sendkeys "%B"   WScript.Sleep 500   Wshshell.Sendkeys "%N"   WScript.Sleep 200   Wshshell.Sendkeys "%S"   WScript.Sleep 200   Wshshell.Sendkeys "%N"      WScript.Sleep 200   Wshshell.Sendkeys "%W"   WScript.Sleep 2000   Wshshell.Sendkeys "{%}systemroot{%}tempbackup.bkf{ENTER}"   WScript.Sleep 200   Wshshell.Sendkeys "%N"   WScript.Sleep 500   Wshshell.Sendkeys "{ENTER}"   WScript.Sleep 15000   Wshshell.Sendkeys "%{F4}"   WScript.Sleep 500   Wshshell.Sendkeys "%Y"   WScript.Sleep 15000   Wshshell.Sendkeys "%C"   WScript.Sleep 500   Wshshell.Sendkeys "%{F4}"   set deleteFile = filesys.GetFile(fileToDelete)   deleteFile.Delete

I have tested this script on XP. Don't press any keys or select other windows while the script is running. Otherwise, you'll end up sending the keystrokes in the script to the currently selected application.

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like