C# 执行bat批处理文件的小例子
程序员文章站
2023-12-22 20:30:46
复制代码 代码如下:private void runbat(string batpath){process pro = new process(); fileinfo fi...
复制代码 代码如下:
private void runbat(string batpath)
{
process pro = new process();
fileinfo file = new fileinfo(batpath);
pro.startinfo.workingdirectory = file.directory.fullname;
pro.startinfo.filename = batpath;
pro.startinfo.createnowindow = false;
pro.start();
pro.waitforexit();
}