Questions tagged [powercfg]

Windows commands that controls power settings.

Documentation:

46 questions
0
votes
1 answer

Power equivalent to powercfg requests

Is there an equivalent in powershellto powercfg -requests listing the processes preventing the sleeping ? Thanks
David Tavan
  • 1
  • 1
  • 1
0
votes
0 answers

lenovo system ignoring SetThreadExecutionState() and was missing "Allow wake timers"?

I have come across a Lenovo IdeaCentre A540-24ICB system with a scheduled task that wakes the computer to start my application and it seems to start but the system goes back to sleep right away. Sometimes it appears to not start (or goes to sleep…
user3161924
  • 1,849
  • 18
  • 33
0
votes
2 answers

How to import a Windows Power Plan with C#

I'm working on a small C# app that will import a power plan to the user's PC and set it as active. It working perfectly with a .bat file when the .pow file is in the same folder and I'm running commands: powercfg -import…
DIY Mods
  • 79
  • 2
  • 9
0
votes
2 answers

How to select the first matching line after an already matched line in powershell?

I am trying to use powershell to query some Windows power settings from the output of powercfg. I have enough information to narrow down the range to a subgroup of settings, but within the text block I still need to find a matching setting using a…
StormSailing
  • 21
  • 2
  • 6
0
votes
0 answers

Create high performance power plan based on existing HP power plan with Powershell

I have a Powershell script I'm working on to automate some processes of our deployment method for a Windows 10 migration. Part of this script activates the High Performance power plan option using powercfg. It works fine on the desktops we use where…
mrk
  • 1
0
votes
3 answers

How to skip lines of command into variable in Python

I want to use the command: subprocess.check_output(["powercfg", "-list"]) which gives me: Existing Power Schemes (* Active) ----------------------------------- Power Scheme GUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (Balanced) Power Scheme…
jangles
  • 303
  • 1
  • 6
  • 22
0
votes
0 answers

Unexepect output of powercfg -requests when the command is executed from a vc++ program

I'm trying to get the output of the powercfg -requests command from a vc++ program. However, it gives a output which is totally different from the output which is given when I manually execute the command in cmd.exe. I tried to search about it and…
San852
  • 19
  • 8
0
votes
1 answer

Mass change powercfg on remote computers

I'm wondering if there is a way to modify the powercfg script to pull from a list of PC's to change the power settings on many remote computers? This is the script i'm using now: psexec \PC-NAME powercfg -change -hibernate-timeout-ac 0 Thanks!
Christian
  • 3
  • 1
  • 3
0
votes
2 answers

How to make powercfg commands auto apply and not have to restart

I'm trying to make a batch file that will change the lid options on our laptops to "Do Nothing" The commands I am using are: powercfg -SETACVALUEINDEX 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347…
0
votes
1 answer

Powercfg changes from cmd line not working

So I'm trying to get a bat file together with power settings that I want to apply. But I'm running into an issue. For some reason, the power button and lid close actions wont change. Here is the relevant code from the bat: set pf=powercfg set…
lobstrosity
  • 37
  • 1
  • 5
0
votes
1 answer

CMD commands won't work properly under "C#"

Can you look at the code and tell me why it won't set-up my powerconfig? It works fine when launched as batch script (so config files are alright), but not when i run same commands under C# public void setPowerProfileLaptop() { …
arti
  • 645
  • 1
  • 8
  • 27
0
votes
1 answer

Unable to get results from more than 2 levels deep in XML document

Thanks for taking a look at my question. I am using powershell to try to parse through an xml file and get only the information I am interested in. Having looked around the net for some tutorials and examples I put together the command below, but…
0
votes
1 answer

CMD: powercfg -setacvalueindex with GUIDs does not work

If I try to run this in CMD: powercfg –setacvalueindex SCHEME_CURRENT SUB_VIDEO VIDEODIM 0 then nothing happens. If I try this: powercfg -setacvalueindex SCHEME_CURRENT SUB_VIDEO VIDEOIDLE 300 then it works? What am I doing wrong? I can change…
nivoe
  • 405
  • 1
  • 4
  • 11
0
votes
1 answer

C# invoking Powershell, DLL could not be loaded

I am having a slightly odd problem.. the following lines run fine directly in powershell: 1) powercfg -AVAILABLESLEEPSTATES 2) powercfg -energy Straight forward enough, -energy generates its file, has other flags I could play with. Running line…
Daniel Cazan
  • 323
  • 1
  • 4
  • 13
-1
votes
1 answer

Where is powercfg located?

I need to use the powercfg tool from my service and I was curious, if it was safe to call it as such: powercfg instead of providing a full path to it. The reason I'm thinking about it is that I keep reading security warnings in…
c00000fd
  • 20,994
  • 29
  • 177
  • 400