Pass shell commands with options

rkmden

New member
Joined
Jan 29, 2006
Messages
3
Programming Experience
1-3
Hello,

I would like to know how you can pass shell commands from a .net form.

Here is what I would like to do:

using the ping command, I would like to capture the Ip address to ping, from text box and pass it to the shell command ping.

User would enter ip address to ping into text box, I would pass it to shell command. ping 192.168.0.1

My reason for this progam is to enable users to use more windows shell commands from a windows form.

Example:

Ping
tracert
netstat with command options

user can select command options and I would pass it into the shell command.

Thanks,

Tam
 
Process.Start(filename, arguments)
where filename and arguments are strings.
 
have a textbox named txtIp on your form then simply:
VB.NET:
Process.Start("ping.exe", txtIp.Text)

assuming the user types in "192.168.0.1" it'll be the same as Process.Start("ping.exe", "192.168.0.1")
 
Thanks

I will give it try, thanks to both of you, for the information. It sure is nice to have a place to go with questions and people who love helping others.

Thanks Again,

TAM:)
 
Back
Top