在C#中的批处理文件执行 [英] batch file execution in c#

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

问题描述

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


  

例外主线程
  java.lang.NoClassDefFoundError的..


什么可以的原因,怎么能解决呢?我现在用的是code:

  VAR SI =新的ProcessStartInfo();si.CreateNoWindow = TRUE;
si.FileName =批处理文件路径;
si.UseShellExecute =真;的Process.Start(SI);


解决方案

您最有可能缺少一些将被包含在您的系统环境变量的参数。

I am running a Java batch file from C#. If I run it by double clicking it executes successfully, but if I run it from C# code it gives exception in thread

"exception in "main" thread java.lang.noclassdeffoundError"..

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#中的批处理文件执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆