myProcess.StartInfo.FileName==@"C:\WINDOWS\system32\ping.exe 10.0.0.1"; blank is not allowed?

  • Thread starter Thread starter James Pang
  • Start date Start date
J

James Pang

myProcess.StartInfo.FileName==@"C:\WINDOWS\system32\ping.exe 10.0.0.1";
//this will not work cant find file name...

myProcess.StartInfo.FileName==@"C:\WINDOWS\system32\ping.exe"; //this works
myProcess.StartInfo.RedirectStandardOutput = true;
myProcess.StartInfo.Verb="10.0.0.1";

// myProcess.StartInfo.Verb = "Print";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.StartInfo.UseShellExecute=false;
myProcess.Start();



string output =myProcess.StandardOutput.ReadToEnd();
System.Console.WriteLine(output);
 
"FileName" contains the name of the executable file you're calling.
parameters cannot be passed in via this string... in your instance ping.exe
is the executable and the ip address is the parameter.
 
Back
Top