三种方法:新建进程,方法去查CreateProcess这个API函数,还可以用管道改变命令行输出定向。使用shell的API函数,如楼上。使用命令行最简单,包含stdlib.h,使用system("...")函数运行命令。
用ShellExecute 示例如下ShellExecute(AfxGetMainWnd()->m_hWnd, _T("open"), _T("sc.exe"), _T("stop InetIp"), _T(""), SW_HIDE);