I have a button that when clicked is running a CMD prompt:
private void PingCommand_Click(object sender, EventArgs e)
{
string strCmdText;
strCmdText = "";
System.Diagnostics.Process.Start("CMD.exe", strCmdText);
}
What I’d like to happen is before the command prompt is opened I’d like a box to appear where I can specify the Hostname/IP that is to be ping’d – is this possible and if so how would I do this?
OR if possible the Hostname/IP address to be set for multiple buttons; ie. ping, map home drive and so on!
Thanks
You can use the following code, it will run the ping command and return the result to the result variable. You need to change the path to ping.exe.