How to enumerate system restore points using WinAPI (not WMI)?

2.3k views Asked by At

Must work for WinXp - Vista - Windows 7

1

There are 1 answers

0
Dirk Vollmar On BEST ANSWER

After having a short look at the available documentation it seems that there is no way around WMI if you want to list existing restore points.

The Windows API only offers you functions for setting and removing restore points:

MSDN also has samples how to use these methods.

For listing the existing restore points you can use the VBScript sample code from here (Note that the code needs elevation on Vista and above):

Set RPSet = GetObject("winmgmts:root/default").InstancesOf ("SystemRestore")
for each RP in RPSet
    wscript.Echo "Dir: RP" & RP.SequenceNumber & ", Name: " & RP.Description & ", Type: ", RP.RestorePointType & ", Time: " & RP.CreationTime
next