Create System Restore Point in Windows 10

275 views Asked by At

I want to use Window API to create System Restore Point (SRP). However, creating SRP is limited in 24 hours.

Here're my steps

  • Add SystemRestorePointCreationFrequency under the registry key HKLM\Software\Microsoft\Windows NT\CurrentVersion\SystemRestore and set to Zero.

In source code

  • Call LoadLibraryW(L"srclient.dll")
  • Get GetProcAddress of SRSetRestorePointW
  • Call SRSetRestorePointW method.

this method only create SRP in the first calling. In the second calling, it always return previous sequenceNumber(STATEMGRSTATUS.llSequenceNumber). it seem that SRSetRestorePointW does not refer SystemRestorePointCreationFrequency.

I tried using powershell to create 2 SRPs, it works well (without reboot system )

Checkpoint-Computer -Description 'Install_TEST' -RestorePointType 'APPLICATION_INSTALL'

This source code is referred from MSD. But it has this issue. (learn.microsoft.com/en-us/windows/win32/sr/using-system-restore)

1

There are 1 answers

0
Michael Jensen On

You must be using Windows 8 or later for getting SystemRestorePointCreationFrequency to work.

  1. On first call set eventtype to BEGIN_SYSTEM_CHANGE.
  2. On second call set eventtype to END_SYSTEM_CHANGE and set SequenceNumber returned from the first call.