j'essaie de réaliser mon premier script autoit en utilisant le wmi.
J'essaie de lister les 5 derniers points de restaurations système. Je pense m'en être sorti dans la traduction VBS -> Autoit et malheureusement je me heurte à un soucis sur la ligne 22.
Pourriez vous m'aider à corriger ce problème ??
Merci
Laddy
Code : Tout sélectionner
If $colItems.Count = 0 Then

Code : Tout sélectionner
$dtmConvertedDate = ObjCreate("WbemScripting.SWbemDateTime")
$objWMI = ObjGet("winmgmts:\\localhost\root\default")
$colItems = $objWMI.ExecQuery("SELECT * FROM SystemRestore", "WQL", 0x10 + 0x20)
$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$i = 0
If $colItems.Count = 0 Then
MsgBox(0, "Aucun Point", "No restore point in system.")
Else
$i = $colItems.Count
;For Each $objItem In $colItems
If IsObj($colItems) Then
For $objItem In $colItems
If $i < 6 Then
$dtmConvertedDate.Value = $objItem.CreationTime
$dtmCreationTime = $dtmConvertedDate.GetVarDate
MsgBox(0, "RP", "[" & $dtmCreationTime & "]" & $objItem.Description)
EndIf
$i = $i - 1
Next
EndIf
EndIf
Func WMIDateStringToDate($dtmDate)
Return (StringMid($dtmDate, 5, 2) & "/" & _
StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _
& " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate, 13, 2))
EndFunc ;==>WMIDateStringToDate
Exit


