SRSetRestorePoint does not create a restore point

151 views Asked by At

I am trying to create a restore point on Windows using the C API function SRSetRestorePoint using the official example from here:

https://learn.microsoft.com/en-us/windows/win32/sr/using-system-restore#example-1-create-a-restore-point

It compiles fine and also runs until calling SRSetRestorePoint which in my case returns false.

SMgrStatus.nStatus than has a value of 5 which is not documented as a status. I am checking for each of the status codes from here:

https://learn.microsoft.com/en-us/windows/win32/api/srrestoreptapi/ns-srrestoreptapi-statemgrstatus#remarks

I am on Windows 10 having everything up-to-date. Every service that should be enabled for creating restore points is enabled and other programs like shut up 10 are able to create restore points. Also on a friend's PC the same thing happens with the little program I (or the Microsoft guys) wrote.

It is also not possible for me to create a restore point using wmic. (See https://www.winhelponline.com/blog/create-system-restore-point-script-windows-10-8-7-vista-xp/)

At least rstrui.exe does not show any new restore points.

Has anyone also encountered that issue or has a solution for this?

Thanks in advance and let me know if you need further information of my system.

1

There are 1 answers

1
kaaleksandr On

To create a restore point, you must have administrator rights.