Does Process.HasExited return erroneous values?
Process p =new Process(); Anybody can make out head or tail of this?
p.StartInfo.FileName = "cmd.exe";
for(int i = 0; i < 1000; i++) {
p.Start();
p.Kill();
if(p.HasExited) {
Console.WriteLine("PROCESSEXITED on Kill");
}else {
Console.WriteLine("FAILURE on Kill");
}
}
When I execute the above block of code I see "FAILURE on Kill" being printed always. However, if I replace the "cmd.exe" with "notepad.exe", then I see "PROCESSEXITED on Kill" being displayed.

