Shows how to use xtd::process class with standard output redirection.
#include <xtd/diagnostics/process>
#include <xtd/console>
#include <xtd/using>
using namespace std;
auto main()->int {
try {
my_process.start_info().use_shell_execute(false);
my_process.start_info().file_name("guidgen");
my_process.start_info().create_no_window(true);
my_process.start();
}
}
catch (
const exception&
e) {
console::write_line(e.what());
}
}