PDA

Click to See Complete Forum and Search --> : help. either make this for me or show me how. im new.


roscom
Nov 20th, 1999, 06:55 AM
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 (http://www.microsoft.com)

it pings www.microsoft.com (http://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...

Yonatan
Nov 21st, 1999, 11:56 AM
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 (http://www.icq.com/19552879)
AIM: RYoni69

roscom
Nov 25th, 1999, 12:00 PM
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?

john_murphy
Nov 25th, 1999, 07:43 PM
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

john_murphy
Nov 25th, 1999, 07:46 PM
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

Joacim Andersson
Nov 25th, 1999, 08:20 PM
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 (http://www.YellowBlazer.com)