ProcessSettings¶
Properties
WorkingDirectory()/ setterCommandLine()/ setterEnvironmentVariables()/ setterOutputMode()/ setter
Important notes
CommandLine(nullptr)andEnvironmentVariables(nullptr)are rejected.Process::Start()later requires a non-emptyCommandLine().ProcessOutputMode::Eventinstalls C callbacks;ProcessOutputMode::Streamexpects stream access;Discardis the default.
using namespace winrt::Windows::Foundation::Collections;
ProcessSettings procSettings;
procSettings.WorkingDirectory(L"/workspace");
procSettings.OutputMode(ProcessOutputMode::Event);
auto cmd = single_threaded_vector<hstring>();
cmd.Append(L"/bin/sh");
cmd.Append(L"-lc");
cmd.Append(L"echo hello");
procSettings.CommandLine(cmd);
auto env = single_threaded_map<hstring, hstring>();
env.Insert(L"DEMO", L"1");
procSettings.EnvironmentVariables(env);