Juanmanuelfangio a écrit:
Houlala, pas facile ça pour l'utilisateur lambda que je suis :ouch: .
Neammoins étant donné que c'est exactement le résultat que je recherche je vais essayer de mettre cela en application.
Un grand merci à tous les 2 pour vos explications :) .
ok bon plus simple fais un copier coller dans un txt de ce que je vais te donner et renomme le en truc.vbs
////////////////////////////////////////////////////////////////////////////////////////
Dim i, j, k, l
Set objShell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
intRow = 2
objExcel.Cells(1, 1).Value = "problem name"
objExcel.Cells(1, 2).Value = "hours"
objExcel.Cells(1, 3).Value = "minutes"
objExcel.Cells(1, 4).Value = "seconde"
i = 0
j = 0
k = 0
l = 0
Do while i = i
If Reachable("216.239.59.99") Then
if j > 0 Then
display(intRow,"end of ping pb to google")
intRow = intRow + 1
Next
end if
j = 0
Else
i = i+1
if i>=100 Then
if j = 0 Then
display(intRow,"ping pb to google")
intRow = intRow + 1
j = j+1
i = 0
Next
end if
end if
end if
loop
On Error Resume Next
Function Reachable(strComputer)
' On Error Resume Next
Dim wmiQuery, objWMIService, objPing, objStatus
wmiQuery = "Select * From Win32_PingStatus Where " & _
"Address = '" & strComputer & "'"
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set objPing = objWMIService.ExecQuery(wmiQuery)
For Each objStatus in objPing
If IsNull(objStatus.StatusCode) Or objStatus.Statuscode<>0 Then
Reachable = False 'if computer is unreacable, return false
Else
Reachable = True 'if computer is reachable, return true
End If
Next
End Function
Function display(IntRow,namePb)
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & "127.0.0.1" & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_LocalTime")
For Each objItem in colItems
objExcel.Cells(IntRow, 1).Value = namePb
objExcel.Cells(IntRow, 2).Value = objItem.Hour
objExcel.Cells(IntRow, 3).Value = objItem.Minute
objExcel.Cells(IntRow, 4).Value = objItem.Second
next
End Function
//////////////////////////////////////////////////////////////////////////////////////
sa devrais pinguer google et t ecrire les resultat dans un fichier exel!