The code below works fine but I need to add the WaitForExit method. But it doesn’t show as being available. What am I missing? Thanks.
ProcessStartInfo process = new ProcessStartInfo("cmd.exe", @"/C " + AppDomain.CurrentDomain.BaseDirectory + "Setupws.exe");
process.Verb = "runas";
process.WindowStyle = ProcessWindowStyle.Hidden;
Process.Start(process);
WaitForExit()is an instance method, which requires that you create an instance ofProcessand run that, rather than using the staticProcess.Start()without capturing the Process return value.Once you create the
Processinstance and set theProcessStartInfoon it, you call it’sStart()instance method, then callWaitForExit()on the instance.