I am using the following code in my visual basic script to enable system protection in windows 10 and it works perfectly fine. I am looking for a visual basic code that checks if protection on particular drive is enabled or not?
and Sets Max usage to 15%.
If Not WScript.Arguments.Named.Exists("elevate") Then
CreateObject("Shell.Application").ShellExecute WScript.FullName _
, WScript.ScriptFullName & " /elevate", "", "runas", 1
WScript.Quit
End If
Dim oSR
Set oSR = GetObject("winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore")
oSR.Enable("C:" & "\")
If someone can highlight the version of windows this code is compatible for, that would be great.