Thanks to Mike Gurman for originally helping me with this.
Calling the shell command should work, but I have had to play around with the syntax of the command. Try:
Call Shell(c:\WINNT\system32\cmd.exe /c ping 1.0.0.1 > c:\Mydir\Myfile.txt, vbhide)
Access will not necessarily wait for the DOS command to finish before it goes on its way, so you might try:
If Dir("c:\Mydir\Myfile.txt") <> "" Then Kill "c:\Mydir\Myfile.txt"
Call Shell(c:\WINNT\system32\cmd.exe /c ping 1.0.0.1 > c:\Mydir\Myfile.txt, vbhide)
While Dir("c:\Mydir\Myfile.txt") = ""
Wend
DoEvents
You will have to specify your own path to the windir folder - I get mine from the windir environment variable. I also like to write the temporary file to the TEMP directory - also gotten from the TEMP environment variable. This makes it easy to import into a table because I always know where the temporary text file is.
Note that I am working on Windows 2000 with Access 2000.
HTH
Jon
[This message has been edited by jal1219 (edited 01-15-2001).]