我想使用ProcessStartInfo cmd.exe来查看命令窗口 [英] Using ProcessStartInfo cmd.exe i want to see the command window

查看:362
本文介绍了我想使用ProcessStartInfo cmd.exe来查看命令窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用``ProcessStartInfo''cmd.exe我想查看命令窗口

ProcessInfo =新的ProcessStartInfo("cmd.exe");
ProcessInfo.WorkingDirectory = @"C:";
ProcessInfo.WindowStyle = ProcessWindowStyle.Normal; ProcessInfo.CreateNoWindow = false;
ProcessInfo.UseShellExecute = false;
Process = Process.Start(ProcessInfo);
Process.WaitForExit(20000);
Process.Close();

我已经尝试过WindowStyle属性,但仍然在屏幕上显示了很短的时间(几乎不显示一秒钟),在其中我无法注意到出现了问题..

Using ''ProcessStartInfo'' cmd.exe i want to see the command window

ProcessInfo = new ProcessStartInfo("cmd.exe");
ProcessInfo.WorkingDirectory = @"C:";
ProcessInfo.WindowStyle = ProcessWindowStyle.Normal; ProcessInfo.CreateNoWindow = false;
ProcessInfo.UseShellExecute = false;
Process = Process.Start(ProcessInfo);
Process.WaitForExit(20000);
Process.Close();

I have tried WindowStyle property, but still it appeares on screen for a very small time (hardly a sec) in which i cant notice whaz going on..

推荐答案

I认为您不需要指定:
I dont think u need to specify:
Minaxi Sajwan写道:
Minaxi Sajwan wrote:

ProcessInfo.WindowStyle = ProcessWindowStyle.Normal;

对它们进行评论并检查.

ProcessInfo.WindowStyle = ProcessWindowStyle.Normal;

Comment them and check.


这篇关于我想使用ProcessStartInfo cmd.exe来查看命令窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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