0

From a how-to-geek article, I get a script like this:

strDesc = "Restore Point by script"
Set oArgs = WScript.Arguments
If oArgs.Count > 0 Then strDesc = oArgs(0)

WScript.Echo "Creating Restore Point: " & strDesc

Set oRestorePoint = GetObject("winmgmts:\\.\root\default:SystemRestore")
strResult = oRestorePoint.CreateRestorePoint(strDesc, 0, 100)

If strResult <> 0 Then
    WScript.Echo "Error " & strResult & ": Unable to create Restore Point"
    WScript.Sleep 444000    'Let user see the result
Else
    WScript.Echo "Restore Point created successfully."
    WScript.Sleep 2000      'Let user see the result
End If

WScript.Quit strResult

I create a scheduled task with this script on Windows 7 to have it create restore point for me daily, and it works well.

However on Windows 8.1/10, I find a strange behavior. Inside a Administrator CMD, executing

cscript CreateRestorePoint.vbs

does not create a new restore point when any restore point has existed(but it still prints "Restore Point created successfully"). In other word, cscript CreateRestorePoint.vbs creates a restore point only after I do vssadmin delete shadows /all, but a second run of cscript CreateRestorePoint.vbs fails due to the existing of first restore point. -- This problem does not happen on Windows 7 SP1.

Can someone explain and fix this problem on Windows 8.1/10 ?

[[[ UPDATE: Problem Solved ]]]

Just as Ken points out in his comment, adding a registry key [HKLM\Software\Microsoft\Windows NT\CurrentVersion\SystemRestore] SystemRestorePointCreationFrequency=10 is the solution(reboot required) . Since Windows 8, Microsoft defaultly allows create only one restore point every 24 hours. SystemRestorePointCreationFrequency=10 decrease that limit to 10 miniutes. See this MSDN page.

  • Try "winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore" (taken from this article). – harrymc Nov 6 '15 at 8:52
2
+100

It is much easier to use power shell for Windows 8.1 and 10. They both have it and you create a one liner and name it .

One note.. you can only run the Checkpoint once every 24 hours.

Place this line in notepad and save the file as CreateCheckpoint.ps1 (make sure that the file is not saved as CreateCheckpoint.ps1.txt).

Checkpoint-Computer -Description "Daily Restore Point"

Goto an administrator command prompt and type powershell. A window will pop open. Just go to the path of the file and type ./createcheckpoint.ps1 and it will create the restore point.

If this works it will show the restore point in your list. If you want to put this in a scheduled task, create a run.bat file and place these lines in it. Change the path below to where you placed the ps1 file. You need to run the bat file as administrator.

@ECHO OFF
PowerShell.exe -command "& c:\restorepoint.ps1 -description 'DailyRP'"
PAUSE
| improve this answer | |
  • Thank you. I need some time to try Powershell out. Did you mean my .vbs fails because of "create only once every 24 hour" limit? Any Microsoft official statement about this? Any way to break this limit? – Jimm Chen Nov 6 '15 at 4:06
  • No such limit - only that Windows will create a restore point automatically if one was not created within the last 24 hours. Minimum rather than maximum. See my comment on the post. – harrymc Nov 6 '15 at 8:54
  • 2
    WARNING: A new system restore point cannot be created because one has already been created within the past 1440 minutes. The frequency of restore point creation can be changed by creating the DWORD value 'SystemRestorePointCreationFrequency' under the registry key 'HKLM\Software\Microsoft\Windows NT\CurrentVersion\SystemRestore'. The value of this registry key indicates the necessary time interval (in minutes) between two restore point creation. The default value is 1440 minutes (24 hours). – NobleMan Nov 6 '15 at 13:19
  • That is if you want to script it and not use the manually way of running it. – NobleMan Nov 6 '15 at 13:20
  • That's a limitation of Checkpoint-Computer alone. – harrymc Nov 9 '15 at 6:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.