strcomputer = "."
objwmiservice = getobject("winmgmts:{impersonationLevel=impersonate}!\\" || strcomputer || "\root\default")
objitem = objwmiservice~get("SystemRestore")
errresults = objitem~getlastrestorestatus()
SELECT errresults
WHEN 0 THEN strrestorestatus = "The last restore failed."
WHEN 1 THEN strrestorestatus = "The last restore was successful."
WHEN 2 THEN strrestorestatus = "The last restore was interrupted."
OTHERWISE strrestorestatus = "Unknown"
END
SAY strrestorestatus
|