8

I am trying to fix a friends computer which is constantly going to sleep on them and sometimes not waking up.

Trying to launch power configuration from the control panel does nothing, and launching powercfg.cpl from the command line results in no output or action.

I have tried powercfg /RestoreDefaultPolicies and I get an access denied error message telling me to try again as an administrator. I am logged in as the only account on the PC, it is administrator, UAC is off, CMD.COM is "Ran as Administrator" and the PC is not part of a domain.

I also get the access denied error while running most of the powercfg, including powercfg -l.

What can I do to get powercfg to give me permissions again?

Malfist
  • 3,119

3 Answers3

2

The power configuration data is stored in the Registry, but all power management is done through the Power service, not with direct Registry access. To determine whether a given user has the authority to perform a power-related operation, the Power service consults a security descriptor that's also stored in the Registry, specifically in this key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\SecurityDescriptors

The ACLs are in SDDL format. For me on a working Windows 10 installation, that key has two values. 0E796BDB-100D-47D6-A2D5-F7D2DAA51F51 contains this string:

O:BAG:SYD:P(A;CI;KR;;;BU)(A;CI;KA;;;BA)(A;CI;KA;;;SY)(A;CI;KA;;;CO)(A;CI;KR;;;AC)

And Default contains this string:

O:BAG:SYD:P(A;CI;KRKW;;;BU)(A;CI;KA;;;BA)(A;CI;KA;;;SY)(A;CI;KA;;;CO)(A;CI;KR;;;AC)

It would be wise to store the old values somewhere in case you need to undo the change. If necessary, use the Permissions entry on the context menu of the SecurityDescriptors key to take ownership and assign write permissions on the key to Administrators. Restart the computer and the new power security will be in effect.

Ben N
  • 42,308
0

This doesn't solve restoring permission issues, but is a possible workaround.

I would try running your commands through a SYSTEM privileged command prompt. Use the PsExec tool from Microsoft's Website, here.

Open a normal Administrator Command Prompt (Win+X then Command Prompt (Admin)).

In it run, psexec –i –s CMD after changing directory (cd) to the executable's location. If prompted with password, enter. If asked for the SYSTEM password, it should be nothing so just press enter.

Then run the commands you were trying before as the Local System.

If you really want to restore your system, I would run, like aforementioned:

sfc /scannow

as well as these if it doesn't solve the issue

chkdsk c: /f /offlinescanandfix
dism.exe /online /cleanup-image /restorehealth
El8dN8
  • 1,955
0

Like Moab had suggested, create a new user in the Admin group and then try it. If you still have problems, you got corrupted system files.

After scanning for malware, try running sfc /scannow.

surfasb
  • 22,896