Export (0) Print
Expand All

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 valueDescription
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

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

None supported

Namespace

\\.\Root\Default

MOF

Sr.mof

See also

SystemRestore

 

 

Community Additions

ADD
Show:
© 2014 Microsoft