C#程序调用bat批处理文件_c# 程序目录外执行批处理文件-CSDN博客

//bat文件路径 string path = "D:\\BC\\Tool\\1.bat"; Process pro = new Process(); FileInfo file = new FileInfo(path); pro.StartInfo.WorkingDirectory = file.Directory.FullName; pro.StartInfo.FileName = path; pro.StartInfo.CreateNoWindow = false; pro.Start(); pro.WaitForExit();