本文介绍了在C#中的批处理文件执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从C#一个Java批处理文件。如果我通过双击运行它成功执行,但如果我从C#$ C $运行c将其给出线程例外

what can be the reason and how can it be solved? I am using the code:

var si = new ProcessStartInfo();

si.CreateNoWindow = true;
si.FileName = "batch-file path";
si.UseShellExecute = true;

Process.Start(si);
解决方案

You are most likely missing some of the parameters that would be included in your systems environment variables.

这篇关于在C#中的批处理文件执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 08:21