question

Lucan01-6873 avatar image
0 Votes"
Lucan01-6873 asked LimitlessTechnology-2700 answered

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

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://docs.microsoft.com/en-us/windows-hardware/design/device-experiences/powercfg-command-line-options] [Microsoft Docs - 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.


[1]: https://docs.microsoft.com/en-us/windows-hardware/design/device-experiences/powercfg-command-line-options



















windows-10-setup
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Lucan01-6873 avatar image
0 Votes"
Lucan01-6873 answered

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!

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

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–

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.