如何使我们的应用程序与现有的cmd.exe进程进行通信 [英] How to make our app communicates with existed cmd.exe process

查看:121
本文介绍了如何使我们的应用程序与现有的cmd.exe进程进行通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我遇到有关cmd.exe的输入和输出的标准重定向的问题.我的执行过程如下:
1)手动运行一个cmd.exe(在这里我们可以将其称为DestinationCMD)实例.
2使用我们自己的应用程序将命令发送到DestinationCMD(例如ping 127.0.0.1)
3当STEP2的作业完成运行时,我们自己的应用程序会自动从DestinationCMD中获取输出.

注意:我们无法在STEP1中以编程方式运行cmd实例;整个过程的确确实是要与现有的cmd通信,而该cmd是我们在一开始就手动启动的.所以我不知道在这种情况下如何重定向输入和输出.

任何想法都会受到赞赏.任何c ++或c#都可以.

谢谢

Hi all ,
I face a problem about the standard redirection of input& output about cmd.exe . my exepcted process like below :
1) Manually run a cmd.exe (we can called it DestinationCMD here)instance .
2 Using our own app send commands to DestinationCMD.(e.g. ping 127.0.0.1)
3 Our own app auto-get the output from DestinationCMD when STEP2''s job finish running.

NOTE: we can not programmatically running the cmd instance in STEP1;the whole process is indeed to communicates with an existed cmd which we manually startup at the begining. So i don''t know how to redirect the input and output on this condition .

Any idea will be much more appreciated . whatever c++ or c# is OK .

Thanks

推荐答案

几乎任何

这篇关于如何使我们的应用程序与现有的cmd.exe进程进行通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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