I'm running a batch file using Process. The problem is I want the batch file to finish its execution and then the next set of lines should be executed. Here's the code snippet.
Process proc = new Process(); proc.StartInfo.FileName = AppDomain.CurrentDomain.BaseDirectory + sFileName+".bat"; proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; proc.Start(); Thread.Sleep(1000); // Method which will be executed after the batch file Method1();
Method1() should execute only when the batch file has completed its execution.
Can anyone please help?