When I
using (var process = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = \"powercfg.exe\",
Arguments = \"-energy\",
I'm afraid I cannot duplicate your results; I get the results file as expected. But if it helps, perhaps my testing parameters will help you narrow down what may be the culprit in your environment:
Set the WorkingDirectory
to the path energy.dll
and powercfg.exe
is located.