Brian Gregory said:
How does one manually create a restore point in Windows 7?
--
Brian Gregory. (In the UK)
(e-mail address removed)
To email me remove the letter vee.
Hi,
Copy the following code into a notepad editor and save it as
'CreateRestorePoint.vbs'. You can then click it (or a shortcut to it) and
automatically name and create a restore point from anywhere.
Hope this helps
Andy
If GetOS = "Windows 7" Then
If WScript.Arguments.length =0 Then
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "wscript.exe", """" & _
WScript.ScriptFullName & """" & " uac","", "runas", 1
Else
CreateSRP
End If
End If
Sub CreateSRP
Set SRP = getobject("winmgmts:\\.\root\default:Systemrestore")
sDesc = ""
sDesc = InputBox ("Enter a Restore Point description.", "Create System
Restore Point","")
If Trim(sDesc) <> "" Then
sOut = SRP.createrestorepoint (sDesc, 0, 100)
If sOut <> 0 Then
WScript.echo "Error " & sOut & _
": Unable to create System Restore Point."
End If
End If
End Sub
Function GetOS
Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
_
".\root\cimv2")
Set colOS = objWMI.ExecQuery("Select * from Win32_OperatingSystem")
For Each objOS in colOS
If instr(objOS.Caption, "Windows 7") Then
GetOS = "Windows 7"
End If
Next
End Function