Last active
October 28, 2015 10:50
-
-
Save UVLabs/95cdb97541090329766b to your computer and use it in GitHub Desktop.
auto restore point without msg boxes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | |
swinmgmts = "winmgmts:\\.\root\default:Systemrestore" | |
GetObject(swinmgmts).CreateRestorePoint "Scheduled Restore Point", 0, 100 | |
End If |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment