Results 1 to 6 of 6

Thread: help. either make this for me or show me how. im new.

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    4

    Post

    hi.
    i need to make a program that i think is simple, but i dont have any knowlege of vb. in DOS, if you type the following line,

    ping -f -l 500 www.microsoft.com

    it pings www.microsoft.com using a mtu of 500. i need a vb app that has two textboxes, and a command button. in onw textbox, you put the MTU number, in the other you put the URL to ping. then you hit the button.

    the button opens a DOS prompt, and assembles the message above, and then runs it. it will then return all the ping info in the DOS pompt. If someone wants to show me how to write this program, or just make it, and send it to me. my email is dms@tweak3d.net
    if you make the app, please send it to that address.
    thanks. its probably simple, but im retarded so...

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Post

    Let's say you put the number in Text1, the address in Text2 and then click Command1 to ping. Use this code:

    Private Sub Command1_Click()
    Call Shell("ping -f -l " & Val(Text1.Text) & " " & Text2.Text, vbNormalFocus)
    End Sub


    ------------------
    Yonatan
    Teenage Programmer
    E-Mail: RZvika@netvision.net.il
    ICQ: 19552879
    AIM: RYoni69

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    4

    Post

    thank you very much. that works quite well. i only have one problem. when the DOS console is done working, it closes instantly, before you have a chance to look at the results. How can i make the DOS window not close?

  4. #4
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Galway, Ireland
    Posts
    316

    Post

    You have a number of options

    you can redirect the output to a text file and then use edit to view

    eg (not tested)
    Private Sub Command1_Click()
    Call Shell("ping -f -l " & Val(Text1.Text) & " " & Text2.Text & "> c:\data.txt", vbNormalFocus)
    End Sub
    call shell("edit c:\data.txt")

    or you can write the command to a bat file and put a pause after it.....

    any more questions please do not hesitate to contact me.

    john_m_murphy@hotmail.com
    Galway
    Ireland

  5. #5
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Galway, Ireland
    Posts
    316

    Post

    Sorry in wrong place

    you can change the vbNormalFoxus as well I'm sure look at the help shell constants for windowsize etc.


    Private Sub Command1_Click()
    Call Shell("ping -f -l " & Val(Text1.Text) & " " & Text2.Text, vbNormalFocus)
    call shetll("edit c:\data.txt", vbNormalFocus)
    End Sub


  6. #6
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Post

    Or try this:

    Call Shell(Environ("ComSpec") & " /k " & "ping -f -l " & Val(Text1.Text) & " " & Text2.Text, vbNormalFocus)

    Good luck!


    ------------------
    Joacim Andersson
    joacim@programmer.net
    joacim@yellowblazer.com
    www.YellowBlazer.com



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