Does anybody know how to capture data from a command window? I am sending the ping command and want to retrieve the data from the command window and write it to a file.
sub pingit
Dim VarX
Dim msg
txtName = Inputbox("Enter the IP our workstation name:"
If txtName <> "" Then
set wshShell = WScript.CreateObject("WScript.shell"
wshShell.run("command.com /k ping " & txtName)
Else
VarX = MsgBox("You have not entered some bad information.", vbCritical, "Error has occured"
End If
end sub
sub pingit
Dim VarX
Dim msg
txtName = Inputbox("Enter the IP our workstation name:"
If txtName <> "" Then
set wshShell = WScript.CreateObject("WScript.shell"
wshShell.run("command.com /k ping " & txtName)
Else
VarX = MsgBox("You have not entered some bad information.", vbCritical, "Error has occured"
End If
end sub