You need to include the “/c” argument to tell cmd.exe what you mean it to do:
proc.Arguments = "/c ping 10.2.2.125";
(You could call ping.exe directly of course. There are times when that’s appropriate, and times when it’s easier to call cmd
.)
More Related Contents:
- How to provide user name and password when connecting to a network share
- How do you sort a dictionary by value?
- Make an Installation program for C# applications and include .NET Framework installer into the setup
- AddBusinessDays and GetBusinessDays
- Windows Forms Splash Screen – Show a form while loading main form
- Is there an alternative to string.Replace that is case-insensitive?
- AppSettings get value from .config file
- How can a Label control display Japanese characters properly when the Font used doesn’t support this language?
- .NET – WindowStyle = hidden vs. CreateNoWindow = true?
- How do I do a SHA1 File Checksum in C#?
- How to check whether an object has certain method/property?
- Can I optionally turn off the JsonIgnore attribute at runtime?
- WPF: How do I loop through the all controls in a window?
- Is there any connection string parser in C#?
- why does DateTime.ToString(“dd/MM/yyyy”) give me dd-MM-yyyy?
- Invalid URI: The format of the URI could not be determined
- datetime to string with time zone
- Call and consume Web API in winform using C#.net
- Collection was modified; enumeration may not execute error when removing a ListItem from a LIstBox
- Collection was modified; enumeration operation may not execute – why?
- Converting String To Float in C#
- How to compare only Date without Time in DateTime types?
- When or if to Dispose HttpResponseMessage when calling ReadAsStreamAsync?
- Use the XmlInclude or SoapInclude attribute to specify types that are not known statically
- How do I programmatically save an image from a URL?
- Days, hours, minutes, seconds between two dates
- Selenium WebDriver throws Timeout exceptions sporadically
- smtpclient ” failure sending mail”
- Is int? thread safe?
- How to empty/flush Windows READ disk cache in C#?