Skip to content

Instantly share code, notes, and snippets.

@UVLabs
Last active October 28, 2015 00:14
Show Gist options
  • Save UVLabs/d1bb106621d4c16f18da to your computer and use it in GitHub Desktop.
Save UVLabs/d1bb106621d4c16f18da to your computer and use it in GitHub Desktop.
Auto restore point script for windows 7 and up
If WScript.Arguments.Count = 0 Then
Set oShell = CreateObject("Shell.Application")
oShell.ShellExecute "wscript.exe", """" & WScript.ScriptFullName & """ Run", , "runas", 1
Else
Set oWshShell = WScript.CreateObject("WScript.Shell")
oWshShell.Popup "Creating a SystemRestore point. Please wait.", 2, "System Restore", 0
swinmgmts = "winmgmts:\\.\root\default:Systemrestore"
GetObject(swinmgmts).CreateRestorePoint "Scheduled Restore Point", 0, 100
MsgBox "System Restore Point created", 0, "System Restore"
End If
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment