- Joined
- Apr 22, 2005
- Sythe Gold
- 23
- Messages
- 7,825
Works with: Windows Vista and Windows 7.
Usage: Makes back ups of your HKEY_LOCAL_MACHINE hive by creating copies of the physical files where the contents of that key are stored.
Cannot be used while Windows is running. You will need to use this in the Command Prompt from the "Repair your computer" option from your Vista/7 install DVD, or if your F8 menu has a "Repair your computer..." option, courtesy of your OEM (press F8 while starting).
Copy this file into C:\Windows\system32\config\BackupRegistry.vbs. You can run this on a non-running Windows installation to make backups of your registry periodically.
If you choose to restore one of the backups you make, go into Windows Recovery Environment, navigate to the folder using Command Prompt, and run the file restore.vbs in that folder.
Usage: Makes back ups of your HKEY_LOCAL_MACHINE hive by creating copies of the physical files where the contents of that key are stored.
Cannot be used while Windows is running. You will need to use this in the Command Prompt from the "Repair your computer" option from your Vista/7 install DVD, or if your F8 menu has a "Repair your computer..." option, courtesy of your OEM (press F8 while starting).
Copy this file into C:\Windows\system32\config\BackupRegistry.vbs. You can run this on a non-running Windows installation to make backups of your registry periodically.
If you choose to restore one of the backups you make, go into Windows Recovery Environment, navigate to the folder using Command Prompt, and run the file restore.vbs in that folder.
Code:
' Registry Backup Tool
' For use in Windows Recovery Environment
' Made by SMR (Govind Parmar) (C) 2010
Option Explicit
Dim oRegEx, oFSys, datetimeStr, outFile, outContents
Set oRegEx = CreateObject("VBScript.RegExp")
Set oFSys = CreateObject("Scripting.FileSystemObject")
oRegEx.Global = True
oRegEx.Pattern = "[^0-9]"
datetimeStr = oRegEx.Replace(Date() & Time(), Empty)
oFSys.CreateFolder("Backup_" & datetimeStr)
oFSys.CopyFile "SYSTEM", "Backup_" & datetimeStr & "\SYSTEM"
oFSys.CopyFile "SOFTWARE", "Backup_" & datetimeStr & "\SOFTWARE"
oFSys.CopyFile "DEFAULT", "Backup_" & datetimeStr & "\DEFAULT"
oFSys.CopyFile "COMPONENTS", "Backup_" & datetimeStr & "\COMPONENTS"
outContents = _
"Option Explicit" & vbCrLf & _
"Dim oRegEx, oFSys, datetimeStr" & vbCrLf & _
"Set oRegEx = CreateObject(" & Chr(34) & "VBScript.RegExp" & Chr(34) & ")" & vbCrLf & _
"oRegEx.Global = True" & vbCrLf & _
"oRegEx.Pattern = " & Chr(34) & "[^0-9]" & Chr(34) & vbCrLf & _
"datetimeStr = oRegEx.Replace(Date() & Time(), Empty)" & vbCrLf & _
"Set oFSys = CreateObject(" & Chr(34) & "Scripting.FileSystemObject" & Chr(34) & ")" & vbCrLf & _
"oFSys.MoveFile " & Chr(34) & "..\SYSTEM" & Chr(34) & ", " & Chr(34) & "..\SYSTEM.BAK." & Chr(34) & " & datetimeStr" & vbCrLf & _
"oFSys.MoveFile " & Chr(34) & "..\SOFTWARE" & Chr(34) & ", " & Chr(34) & "..\SOFTWARE.BAK." & Chr(34) & " & datetimeStr" & vbCrLf & _
"oFSys.MoveFile " & Chr(34) & "..\DEFAULT" & Chr(34) & ", " & Chr(34) & "..\DEFAULT.BAK." & Chr(34) & " & datetimeStr" & vbCrLf & _
"oFSys.MoveFile " & Chr(34) & "..\COMPONENTS" & Chr(34) & ", " & Chr(34) & "..\COMPONENTS.BAK." & Chr(34) & " & datetimeStr" & vbCrLf & _
"OFSys.MoveFile" & Chr(34) & "SYSTEM" & Chr(34) & ", " & Chr(34) & "..\SYSTEM" & Chr(34) & vbCrLf & _
"OFSys.MoveFile" & Chr(34) & "SOFTWARE" & Chr(34) & ", " & Chr(34) & "..\SOFTWARE" & Chr(34) & vbCrLf & _
"OFSys.MoveFile" & Chr(34) & "DEFAULT" & Chr(34) & ", " & Chr(34) & "..\DEFAULT" & Chr(34) & vbCrLf & _
"OFSys.MoveFile" & Chr(34) & "COMPONENTS" & Chr(34) & ", " & Chr(34) & "..\COMPONENTS" & Chr(34) & vbCrLf & _
"WScript.Echo " & Chr(34) & "Current COMPONENTS, DEFAULT, SOFTWARE, and SYSTEM hives backed up as *.BAK." & Chr(34) & " & datetimeStr" & vbCrLf
Set outFile = oFSys.CreateTextFile("Backup_" & datetimeStr & "\restore.vbs")
outFile.WriteLine(outContents)
WScript.Echo "Backup of current COMPONENTS, DEFAULT, SOFTWARE, and SYSTEM hives created in folder Backup_" & datetimeStr & "." & vbCrLf & "Use the file Backup_" & datetimeStr & "\restore.vbs while in Windows Recovery Environment to restore this backup."














