Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell, Ping Return Value Code

Status
Not open for further replies.

cykopat

Technical User
Jun 4, 2003
56
US
Does anyone have a FAQ or code for Pinging an IP address from a field, writing the results to a file and returning those results to a textbox on a form?

Patrick
 
create this Pinger.BAT file
Code:
@ echo off
ping %%1 > C:\ping.txt
create a linked table to c:\ping.txt
run this code from vb

Code:
dim rst as recordset
a=shell("pinger.bat " & me.text1
set rst = currentdb.openrecordset("ping")
do while not rst.eof
res = res & cbcrlf & rst(0)
rst.movenext
loop
me.text2=res


not tested but should work




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top