1

I am trying to change the action taken by windows when I close my laptop lid by changing the values stored in the registry location:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\4f971e89-eebd-4455-a8de-9e59040e7347\5ca83367-6e45-459f-a27b-476b1d01c936

Through the DWORDS DCSettingIndex and ACSettingIndex

But it has no effect, it looks like the registry has nothing to do with the options I choose in the control panel. I am changing these options using a script so it would be better if I did it through the registry.

It is my first time to deal with registry so please till my if I am doing something wrong.

2
  • The registry is not a user tool and it is never better to use the registry than to use the power commands or GUI interface (readily available and work).
    – John
    Aug 2, 2021 at 13:02
  • given you want to script this, just use powercfg /change ... to make changes to the settings. See powercfg /? in a command prompt for all parameters.
    – LPChip
    Aug 2, 2021 at 13:16

1 Answer 1

0

AS @John states, generally, do not use the Registry for something better handled through the OS tools. That said, if you want to copy the portion of the Registry concerned with power options to restore later,

  • Make any needed changes using the Power Options CPL.
  • Open Regedit and go to the key you want to save.

Exporting Registry Key

  • Right-click on the key and select Export.
  • Name the file as you wish and save it.

Should the Power Options get changed,just run the .reg file to restore the key to the saved settings.

It is also possible to examine the .reg file, but a mistake in editing it can be dangerous, making the OS unusable.

You must log in to answer this question.