Command line output:
C:\powercfg -availablesleepstates
The following sleep states are available on this system:
Standby (S3)
Hibernate
Hybrid Sleep
Fast Startup
The following sleep states are not available on this system:
…
Curiously, although the hibernation file is located in the root directory, it could not be detected by PowerShell. Apparently this is a kind of virtual file.
$Path = "$Env:SystemDrive\hiberfil.sys"
# Result $False
Test-Path -Path $Path
# Result…
I wrote a batch file that imports a custom power plan using powercfg. It works but after running the script, I have to go in to the Windows Power Plan and manually select the plan for it to become active.
I would prefer if the selection could be…
I'm writing a batch file to import power plans in windows 10. My script is mostly done but I need a way to alert the user if there is an error. Ideally, the script would echo the exact error and prompt the user to hit a key to acknowledge it. Here's…
This is an addition to an Old Thread
How to start `powercfg.exe -energy` from a .NET app?
I'm trying to run powercfg /BatteryReport. It throws an error
"The Energy Consumption Efficiency Diagnostic library (energy.dll) couldn't be loaded."
This…
I'm running Python 2.7.11 on Windows 10 and I need to automatically pause and resume the desktop background slideshow for a program.
My current approach is to issue commands to the command prompt thru Python's subprocess module. Below are the…
I was trying to call powercfg tool from my 32-bit application running on a 64-bit version of Windows 8.1 using CreateProcess with the following command as lpCommandLine parameter:
"powercfg -waketimers"
It worked fine, except that purely by chance…
I'm trying to automate checking what the current power plan is and then return a response based on that. Here's what I have:
import subprocess
plan = subprocess.call("powercfg -getactivescheme")
if 'Balanced' in plan:
print Success
When I…
To programtically set display brightness I had two options :
Use PowerWriteACValueIndex and PowerWriteDCValueIndex API
Use PowerCfg.exe
Now, I tried both, and both gave me the same (weird) result. Here's the code I'm using :
With…
I think this is not a duplicate question of How to start `powercfg.exe -energy` from a .NET app?
In the other question, the OP has accepted an answer but the issue just resolved on its own so we don't know what is the solution (I'm not entirely…
I'm trying to execute a hidden process to retrieve the output.
For this task I'm trying to use Exec method but the problem that I see is that I can't hide the process window?.
I've seen an alternative way using Run method to start the process…
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…
I would like to use the powercfg tool in Windows to duplicate my current power scheme and then change the new scheme (enabling me to revert back to the old scheme if I mess something up) using a batch file.
I know that powercfg -getactivescheme…
I know I can set the monitor timeout to 'never' using powercfg -change -monitor-timeout-ac 0
However, how can I check what the value of monitor timeout is? Without setting it to a new value?
Working on a Caffinate Alternative for Windows and was wondering if there was a way I could grab just the GUID of the current used powerplan without the rest of the output heres a example of what I mean.
What I am getting... when using powercfg…