Bonjour,
Je souhaite utiliser un script ci-dessous pour activer le point de restauration sur les postes clients a l'aide d'un GPO:
If WScript.Arguments.length =0 Then
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "wscript.exe", Chr(34) & _
WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1
Else
Drive = "c:\"
set SRP = GetObject("winmgmts:\\.\root\default:SystemRestore")
GetObject("winmgmts:\\.\root\default:SystemRestore").enable(drive)
End If
Mais je me dis que l'idéal serait de vérifier avant si le point de restauration est déja actif et je pense à un système de ce style mais il ne fonctionne pas.
If WScript.Arguments.length =0 Then
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "wscript.exe", Chr(34) & _
WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1
Else
drive="c:\"
set SRP = GetObject("winmgmts:\\.\root\default:SystemRestore")
If SRP.enable(drive) =False Then
GetObject("winmgmts:\\.\root\default:SystemRestore").enable(drive)
'Else'
'MsgBox "bye"'
End If
End If
Avez-vous une idée pour m'aider?
Merci d'avance.
Cordialement,
Chabin972
Partager