CREATE A RESTORE POINT ON ANY WINDOWS:
THIS IS A VBS SCRIPT NOT A BAT! So change the text file from .txt to .vbs
If GetOS = "Windows XP" Then
CreateSRP
End If
If GetOS = "Windows Vista" Or 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 = "Manual Restore Point"
If Trim(sDesc) <> "" Then
sOut = SRP.createrestorepoint (sDesc, 0, 100)
If sOut <> 0 Then
WScript.echo "Error " & sOut & _
": Unable to create 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"
ElseIf instr(objOS.Caption, "Vista") Then
GetOS = "Windows Vista"
elseIf instr(objOS.Caption, "Windows XP") Then
GetOS = "Windows XP"
End If
Next
End Function