I don't have any issues with below code. Should work alright.
The only difference is I used "outlook" in place of "outlook.exe"
static void Main(string[] args)
{
int j = 0;
while (!processRunning("outlook"))
System.Threading.Thread.Sleep(10000);
System.Threading.Thread thread = new System.Threading.Thread(DoWork);
thread.Start();
}
static void DoWork()
{
Shell.ExecuteCommand(@"procdump.exe -ma -e Outlook.exe");
}
static bool processRunning(string processName)
{
Process[] processlist = Process.GetProcesses();
var i = processlist.Where(p => p.ProcessName.ToLower().Contains("outlook"));
return (i.Count() > 0);
}