I can find a lot of threads discussing Process.Start but none which sound like mine. The code below has been working for years on Windows Server 2003 & 2008. I'm now trying to install the same application on 2012 but although "My.exe" starts, Process.Start itself hangs - so "Started" is never logged. Can anybody suggest what the issue might be?
Many thanks in advance,
Michael
ProcessStartInfo psi = new ProcessStartInfo("C:\\My.exe");
psi.UseShellExecute = false;
psi.LoadUserProfile = false;
psi.WindowStyle = ProcessWindowStyle.Normal;
psi.ErrorDialog = false;
if (Environment.OSVersion.Version.Major >= 6) psi.Verb = "runas";
psi.Arguments = "\"MyArgs\"";
psi.RedirectStandardError = true;
psi.RedirectStandardOutput = true;
_logger.Info("Starting");
_process = Process.Start(psi);
_logger.Info("Started");