For example i have this code:
Process proc = new Process(); proc.EnableRaisingEvents = true; proc.StartInfo.UseShellExecute = false; proc.StartInfo.FileName
Add dxdiag.bat to your project by right-clicking on the project and select add existing item. Then, once it is in your project, right-click the dxdiag.bat file and select properties. Set the "copy to output directory" property to "always".