Ping a site that is usually online.

VB Code:
  1. Option Explicit
  2.  
  3. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
  4. ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  5.  
  6. Private Const SW_SHOWNORMAL As Long = 1
  7. Private Const SW_HIDE As Long = 0
  8.  
  9. Private Sub Command1_Click()
  10.     ShellExecute Me.hwnd, "Open", "C:\Windows\System32\CMD.exe", " /c ping [url]www.google.com[/url] >> D:\ping.txt", "D:\", SW_SHOWNORMAL
  11.     Shell "notepad D:\ping.txt", SW_SHOWNORMAL
  12. End Sub