Must work for WinXp - Vista - Windows 7
Asked
Active
Viewed 2,274 times
0
-
WMI should be available on the platforms that you require. It might be a problem with Win 2000 though. – Dirk Vollmar Feb 25 '10 at 15:23
-
@divo: System Restore does not exist on Windows 2000. – SLaks Feb 25 '10 at 20:21
-
@SLaks: So even less reason not to use WMI ;) – Dirk Vollmar Feb 25 '10 at 20:57
1 Answers
3
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

Dirk Vollmar
- 172,527
- 53
- 255
- 316