I need to start process and read its stdout output ,without starting the cmd(dos black window)
Can I do that? For example I have this code that opning the cmd window . this is what I like to avoid .
- Code: Select all
std::string cmd = "C:\\WINDOWS\\system32\\ipconfig";
std::vector<std::string> args;
args.push_back("--help");
Pipe outPipe;
ProcessHandle ph = Process::launch(cmd, args, 0, &outPipe, 0);
PipeInputStream istr(outPipe);
std::string s;
int c = istr.get();
while (c != -1) { s += (char) c; c = istr.get(); }
int rc = ph.wait();





