this should get you started (its off something else i made, in which i modded some other code)
Public Function obtainip() As String
On Error GoTo errormsg
If ipopt = True Then
ipaddress = CInt(iptxt1.Text) & "." & CInt(iptxt2.Text) & "." & CInt(iptxt3.Text) & "." & CInt(iptxt4.Text)
obtainip = ipaddress
'Determine the class of the ip address
If CInt(iptxt1.Text) < 127 Then
classlbl.Caption = "Class A IP"
End If
If CInt(iptxt1.Text) = 127 Then
classlbl.Caption = "Loopback Address"
End If
If CInt(iptxt1.Text) > 127 And CInt(iptxt1.Text) < 192 Then
classlbl.Caption = "Class B IP"
End If
If CInt(iptxt1.Text) > 191 And CInt(iptxt1.Text) < 224 Then
classlbl.Caption = "Class C IP"
End If
Else
obtainip = urltxt.Text
End If
Exit Function
errormsg:
MsgBox ("Not a valid input - Check internet connection too")
End Function
Private Sub pngcmd_Click()
ReadL.Text = ""
Dim shlcmd, comstring, IP, outpath As String
IP = obtainip
outpath = App.Path & "\ping.txt" 'Can be whereever you want
DoEvents
comstring = "command.com /c ping -a " & IP & " > " & outpath
shlcmd = Shell(comstring, vbHide)
'MsgBox ("Output has been saved to " & outpath & vbCrLf & "(Local Path)")
Timer2.Interval = 12000
stat1.Caption = "Loading......"
End Sub