Sub test()
Dim I As Integer, Action As String, MyData As DataObject
Shell "C:\Windows\system32\cmd.exe", vbNormalFocus
Attente (5)
Action = "Ping 255.255.255.255"
For I = 1 To Le(Action)
SendKeys Mid(Acion, I, 1), True
Next I
SendKeys "{ENTER}"
Attente (20)
'SendKeys Là il faudrait trouver comment copier le résultat...
MyData.GetFromClipboard
MsgBox MyData.GetText(1)
End Sub
Function Attente(Temps As Integer)
Dim Start
Start = Timer ' Définit l'heure de début.
Do While Timer < Start + Temps
DoEvents ' Donne le contrôle à d'autres processus.
Loop
End Function