//
// Summary:
// Gets or sets a value indicating whether to use the operating system shell
// to start the process.
//
// Returns:
// true to use the shell when starting the process; otherwise, the process is
// created directly from the executable file. The default is true.
[DefaultValue(true)]
[MonitoringDescription("ProcessUseShellExecute")]
[NotifyParentProperty(true)]
public bool UseShellExecute { get; set; }
Run Code Online (Sandbox Code Playgroud)
如果我们生成一个新进程,我们什么时候需要将UseShellExecute设置为True?
我试图从我们的32位.NET应用程序运行64位可执行文件(java.exe).我正在使用Process类和调用cmd /c <command name>以支持所有可能的命令(如dir,cd等).
问题是在我的机器上我安装了64位版本的JRE,而java.exe只能从C:\Windows\System32文件夹(x64)中获得.我已经尝试cmd.exe通过调用显然启动64位版本C:\Windows\System32\cmd.exe但SysWOW64由于调用进程为32位而被重定向到.
我还能做些什么才能让它发挥作用吗?
编辑整个cmd /c事情是一个红色的鲱鱼.它不是问题的一部分,能够运行64位可执行文件.