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;