I am running below command in windows command prompt and it's giving output like below,
C:\>logman.exe FabricTraces | findstr Root Root Path: C:\ProgramData\Windows Fabric\Fabric\log\Traces\ Now, I am trying to mimic the same in C# program and would like to capture the output (C:\ProgramData\Windows Fabric\Fabric\log\Traces\) into a variable.
How to do this, here's the code I tried,
Process P = Process.Start("logman.exe", "FabricTraces | findstr Root"); P.WaitForExit(); var result = P.ExitCode;
cmdwith the/Coption if you want to use pipes and other shell features.FabricTraces | findstr Rootisn't the argument string of the process...