How to launch a .bat file in a C# windows Service project

Posted by freedark on Stack Overflow See other posts from Stack Overflow or by freedark
Published on 2010-04-12T13:30:31Z Indexed on 2010/04/12 13:33 UTC
Read the original article Hit count: 182

Filed under:

I create a C# Windows servive project, then I want to run a .bat file, but I find that it does not run

        Process pInfo = new Process();
        pInfo.StartInfo.UseShellExecute=false;
        pInfo.StartInfo.CreateNoWindow=true;
        pInfo.StartInfo.FileName =bat file name ;

        pInfo.StartInfo.RedirectStandardOutput = true;

        pInfo.Start();

Could anyone help me ?

© Stack Overflow or respective owner

Related posts about c#