CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 1999
    Location
    France
    Posts
    29

    Ping instruction

    Hi everybody

    I want to make a little program which will make a ping to a server at the dos prompt and which will indicate if the ping works.
    My question is : How can I know if the ping works???

    More generally, how can I get the information in the dos windows?
    Ex : I got an environmental variable called MYVAR
    If I enter "set MYVAR" at the dos prompt, How can I get the information ??

    Thanx

    Fzz


  2. #2
    Join Date
    Sep 1999
    Posts
    202

    Re: Ping instruction


    option Explicit

    private Sub Form_Click()
    Dim sCommand as string, i as Integer
    ' execute command
    sCommand = "Ping "
    Shell "command.com /c " & sCommand & " > c:\info.txt"
    ' wait
    for i = 1 to 10000
    DoEvents
    next
    ' show file
    Shell "notepad c:\info.txt", vbNormalFocus
    End Sub





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured