GetLastRestoreStatus method of the SystemRestore class

Retrieves the status of the last system restore.

Syntax

uint32 GetLastRestoreStatus();

Parameters

This method has no parameters.

Return value

The method returns one of the following status values.

Return value Description
0
The last restore failed.
1
The last restore was successful.
2
The last restore was interrupted.

Examples

'GetLastRestoreStatus Method of the SystemRestore Class
'Retrieves the status of the last system restore.
Set obj = GetObject("winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore")
stat = obj.GetLastRestoreStatus()
If stat = 0 Then
    wscript.Echo "Failed"
ElseIf stat = 1 Then 
    wscript.Echo "Success"
ElseIf stat = 2 Then
    wscript.Echo "Interrrupted"
End If

Requirements

Requirement Value
Minimum supported client
Windows XP [desktop apps only]
Minimum supported server
None supported
Namespace
Root\Default
MOF
Sr.mof

See also

SystemRestore