Function to execute a .bat file and wait for its term in C Sharp

Reference used: using System.Diagnostics;

        
private void EjecutarBat(string pathArchivoBat)
{
  Process proceso = new Process();
  proceso.StartInfo.FileName = pathArchivoBat;
  proceso.Start();
  proceso.WaitForExit(); //Wait for the execution of the .bat file to finish
            
}

regards

También te podría gustar...

Deja una respuesta

Tu dirección de correo electrónico no será publicada.