Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello,
I want to write a MFC application just like the CMD.exe,and send a command to it and run my command.

Maybe I can write console application like this:

#include<windows.h>
#incldue<stdlib.h>
{
system("route -p add 0.0.0.0 mask 0.0.0.0 192.168.0.1");
}
Or maybe I can press the strings: route -p add 0.0.0.0 mask 0.0.0.0 192.168.0.1 Then press the Enter button in the CMD.EXE after I opened it

But He requires a MFC application.

How Can I Do It? I would appreciate if you could show me your code.
Thanks in advance.
Posted

1 solution

Google "mfc createprocess". You'll get over 1.6 million hits.
 
Share this answer
 
Comments
eagle_chen 11-Sep-10 12:06pm    
Thanks!I will have a try.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900