Run System Commands in The Background With c#

I needed to run 200 odd batch files sequentially in the background for a speech classifier. The code to do this involved writing a batch file in code to include the commands i wanted the HTK to run, probably not the best way of doing this but HTK is funny with file paths with spaces etc and this was the quickest way.

Process hvite = new Process();
hvite.EnableRaisingEvents = false;
hvite.StartInfo.FileName = “temp.bat”;
hvite.StartInfo.CreateNoWindow = true;
hvite.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
hvite.Start();
hvite.WaitForExit();

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>