powercfg

How do I read individual PowerCfg settings?

耗尽温柔 提交于 2020-01-15 12:15:07
问题 If I run this command: powercfg -SETACTIVE 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c ...I can subsequently run this command: powercfg -GETACTIVESCHEME ...and it will tell me what I did. (It will output 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c.) Similarly, if I run this command: powercfg -change -monitor-timeout-dc 0 I want to know how I can query that. Is there some powercfg flag where I can read the current value of monitor-timeout-dc , and other settings like that? 回答1: This returns the monitor

How to start `powercfg.exe -energy` from a .NET app?

不羁的心 提交于 2019-12-29 01:50:05
问题 When I using (var process = new Process { StartInfo = new ProcessStartInfo { FileName = "powercfg.exe", Arguments = "-energy", RedirectStandardOutput = true, UseShellExecute = false, } }) { process.Start(); process.WaitForExit(); } It outputs: A biblioteca de Diagnóstico de Eficiência de Consumo de Energia (energy.dll) não pôde ser carregada. Translated to English: The Energy Consumption Efficiency Diagnostic library (energy.dll) couldn't be loaded. Even when running as admin. 回答1: I'm afraid

How can run functions of powercfg by C# code?

强颜欢笑 提交于 2019-12-24 03:25:21
问题 how can run functions of powercfg by c# code? for example I want to run this, for Set turn off the display: never powercfg -CHANGE -monitor -timeout -ac 0 回答1: Call it with Process.Start: Process.Start("powercfg", "-CHANGE -monitor -timeout -ac 0"); 回答2: You can call Process.Start to run an executable. For example: Process.Start(fileName: "powercfg", arguments: "-CHANGE -monitor -timeout -ac 0"); However, if you're only trying to disable auto-off while your program is running, you should

How to READ the auto sleep time of pc from powercfg.exe (batch) [closed]

不问归期 提交于 2019-12-13 22:27:14
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I have a batch file that automatically sets the computer to sleep after 0 minutes (aka never sleep). Then I want to set it back to what it was before. My question is how would I set the current sleep time to a variable before I turn it off? Thanks in advance! CLARIFICATION: I'm

How does powercfg -energy detect the requested timer resolution

心已入冬 提交于 2019-12-11 12:41:08
问题 How does "powercfg -energy" command detect the requested timer resolution of each individual program running at the time? I imagine one way would be injecting into each of running processes and inside that process calling timeEndPeriod for each increased resolution (values 1-15) in a loop over these resolutions and checking whether the timeEndPeriod call for a current resolution returns TIMERR_NOCANDO or TIMERR_NOERROR (note: these return values are NOT correspondingly false and true ) . And

How to start `powercfg.exe -energy` from a .NET app?

删除回忆录丶 提交于 2019-12-11 09:41:10
问题 When I using (var process = new Process { StartInfo = new ProcessStartInfo { FileName = "powercfg.exe", Arguments = "-energy", RedirectStandardOutput = true, UseShellExecute = false, } }) { process.Start(); process.WaitForExit(); } It outputs: A biblioteca de Diagnóstico de Eficiência de Consumo de Energia (energy.dll) não pôde ser carregada. Translated to English: The Energy Consumption Efficiency Diagnostic library (energy.dll) couldn't be loaded. Even when running as admin. 回答1: I'm afraid

Computer not obeying powercfg GUID command line instructions

醉酒当歌 提交于 2019-12-11 02:58:55
问题 I am trying to write a script to toggle the lid action between sleep/do nothing by using powercfg.exe and the relevant GUID. powercfg -SETACVALUEINDEX 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0 powercfg -SETDCVALUEINDEX 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0 To do nothing, and powercfg -SETACVALUEINDEX 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89

How to start `powercfg.exe -energy` from a .NET app?

不问归期 提交于 2019-11-28 14:17:45
When I using (var process = new Process { StartInfo = new ProcessStartInfo { FileName = "powercfg.exe", Arguments = "-energy", RedirectStandardOutput = true, UseShellExecute = false, } }) { process.Start(); process.WaitForExit(); } It outputs: A biblioteca de Diagnóstico de Eficiência de Consumo de Energia (energy.dll) não pôde ser carregada. Translated to English: The Energy Consumption Efficiency Diagnostic library (energy.dll) couldn't be loaded. Even when running as admin. I'm afraid I cannot duplicate your results; I get the results file as expected. But if it helps, perhaps my testing