Powercfg Command-Line for editing the existing value of Critical Battery Action in Command Prompt

Lucan01 1 Reputation point
2022-04-23T06:44:59.84+00:00

EDITED: The answer I am looking for is powercfg **-setacvalueindex** SCHEME_CURRENT SUB_BATTERY BATACTIONCRIT 0 I did not read the docs carefully and I mindset thought it is focused on -setdcvalueindex.

I am working with this document from Microsoft: This was crossposted and a moderator asked me to repost in here.

[https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/powercfg-command-line-options] [Microsoft Learn - Powercfg Command Line Options]

Working on unattended stuffs for next Windows 11 so these are a few of stuffs I needed to work with Powercfg ( Power configuration ).

I have a question after setting up the value using the command I found online to bypass the bad battery. Apparently it was trapped into DC value ( for battery ). It would seem no way to edit the AC value. See the code in below.

Power Setting GUID: 637ea02f-bbcb-4015-8e2c-a1c7b9c0b546 (Critical battery action)` GUID Alias: BATACTIONCRIT `` Possible Setting Index: 000 Possible Setting Friendly Name: Do nothing
Possible Setting Index: 001 Possible Setting Friendly Name: Sleep` Possible Setting Index: 002 Possible Setting Friendly Name: Hibernate `` Possible Setting Index: 003 Possible Setting Friendly Name: Shut down
Current AC Power Setting Index: 0x00000002` Current DC Power Setting Index: 0x00000000`

Want both AC and DC to set as Do Nothing which value should be 0. I am not sure why or how I can work with two index values if i can't see the command that I can set for AC power index. After executing the command: powercfg -setdcvalueindex SCHEME_CURRENT SUB_BATTERY BATACTIONCRIT 0I was able to check and see the power setting from setting side, Battery value was changed into Critical Battery Action into DO NOTHING. AC power, i was not able to set the Do Nothing.

Please help with not using SUB_BATTERY but it was only thing i could see. How can i do this and thank you. it was because of Windows's automatic shutdown when bad battery produced 0% at AC plugged in. This is a workaround but I am missing the last value for AC Power Setting Index.

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Lucan01 1 Reputation point
    2022-04-23T12:17:19.383+00:00

    Edited> I found the answer.

    I felt incredible stupid enough not to look carefully inside powercfg switch. The answer I am looking for is /setacvalueindex

    Resolved. Saving this for everyone's information in future, and I will edit my post to include this answer.

    Thanks all!

    0 comments No comments

  2. Limitless Technology 39,926 Reputation points
    2022-04-26T15:19:34.977+00:00

    Hi there,

    Yes, in the Command-line options /setacvalueindex Sets the value associated with a power setting while the system is powered by AC power.

    I hope the above command fulfills your need and also you have /batteryreport before editing the existing value of Critical Battery


    --If the reply is helpful, please Upvote and Accept it as an answer–

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.