PING program help.

Not quite shur if this belongs in beginner or not, because im not exactly a C++ pro yet but this is more of a question for programs to run on windows, so im putting it here. Hope im not wrong for doing that.

What I'm looking to do, just for the simple purpous of testing myself is to create some sort of network application... And no I do not expect it to hold any real value, I just would like to do it to test myself. So getting to the question I would like to ask, how can I get a C++ program to enter commands into CMD? Here is the example I will give of what I want to do for this program.

You are introduced with a line that says "Pleas enter the IP address you would like to ping:"

To which you enter the IP address. Then you are asked "Pleas enter how many packets you would like to send:"

To which you enter the number of packets you would like to send. Then you are asked "Pleas enter the size of the packets in bytes:"

To which, yes you guessed it, enter the number of bytes of information you would like to send at once.

Now I must clarify that I am.. well, for the most part certen with how you would go about taking the info from the user but I'm not certen what you would do with it once you got the info. (I really hope this isint making me sound stupid :P ) Also, would there be a way to send packets larger then the max that windows would allow? (I believe its like 65000 bytes or something?) and yes, of course it would have to print out the read outs of each packet so you know weather or not it was successfully sent or not.

This is really my first idea for a network baised program but i figure i gotta start somewhere. Thanks to all who can help.

(I also plan on giving it more legitimate uses, even though like i said before i have no real need for the program other then to just test myself. Like IP renew and IP release, ect. Basically any cool little thing i can think of adding i want to try adding, so long as its network biased.)
I did it before.

You can use Windows built-in functions (Unportable and requires Admin permissions)...
Or you can create a server-client application which works like this:

Client sends data to server
Server sends it back plainly to the client

The result will be this:

Client sends information about the SENT time.
Server sends the SENT time back to the client.
Client reads the SENT time back.
Client compares SENT with READ time.
It will be the ping.

Kind of like what happens on IRC.
But I mean how exactly do i input commands into CMD with C++??
Can anyone help?
Topic archived. No new replies allowed.