AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / computer / Perguntas / 1619799
Accepted
Ξένη Γήινος
Ξένη Γήινος
Asked: 2021-01-23 00:28:12 +0800 CST2021-01-23 00:28:12 +0800 CST 2021-01-23 00:28:12 +0800 CST

Como alterar as opções de energia pelo registro ou pela linha de comando?

  • 772

Quero alterar powercfg.cpl"Opções de energia" diretamente pelo registro.

Especificamente, eu quero mudar isso:

insira a descrição da imagem aqui

Para essas configurações:

insira a descrição da imagem aqui

Estou usando um computador desktop em corrente alternada, portanto a economia de energia é desnecessária e prejudica o desempenho; Desativei a inicialização rápida no BIOS.

Eu abri esta chave de registro em regedit.exe:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power

E as únicas coisas que consigo ver dentro da chave são:

HiberFileSizePercent REG_DWORD 0
HibernateEnabled REG_DWORD 0
HibernateEnabledDefault REG_DWORD 1

Eu tentei usar powercfg.exee isso é o que eu tenho:

C:\Windows\system32>powercfg /l

Existing Power Schemes (* Active)
-----------------------------------
Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e  (Balanced)
Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c  (High performance) *
Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a  (Power saver)

C:\Windows\system32>powercfg /q
Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c  (High performance)
  GUID Alias: SCHEME_MIN
  Subgroup GUID: 0012ee47-9041-4b5d-9b77-535fba8b1442  (Hard disk)
    GUID Alias: SUB_DISK
    Power Setting GUID: 6738e2c4-e8a5-4a42-b16a-e040e769756e  (Turn off hard disk after)
      GUID Alias: DISKIDLE
      Minimum Possible Setting: 0x00000000
      Maximum Possible Setting: 0xffffffff
      Possible Settings increment: 0x00000001
      Possible Settings units: Seconds
    Current AC Power Setting Index: 0x00000000
    Current DC Power Setting Index: 0x000004b0

  Subgroup GUID: 02f815b5-a5cf-4c84-bf20-649d1f75d3d8  (Internet Explorer)
    Power Setting GUID: 4c793e7d-a264-42e1-87d3-7a0d2f523ccd  (JavaScript Timer Frequency)
      Possible Setting Index: 000
      Possible Setting Friendly Name: Maximum Power Savings
      Possible Setting Index: 001
      Possible Setting Friendly Name: Maximum Performance
    Current AC Power Setting Index: 0x00000001
    Current DC Power Setting Index: 0x00000001

  Subgroup GUID: 0d7dbae2-4294-402a-ba8e-26777e8488cd  (Desktop background settings)
    Power Setting GUID: 309dce9b-bef4-4119-9921-a851fb12f0f4  (Slide show)
      Possible Setting Index: 000
      Possible Setting Friendly Name: Available
      Possible Setting Index: 001
      Possible Setting Friendly Name: Paused
    Current AC Power Setting Index: 0x00000000
    Current DC Power Setting Index: 0x00000000

  Subgroup GUID: 19cbb8fa-5279-450e-9fac-8a3d5fedd0c1  (Wireless Adapter Settings)
    Power Setting GUID: 12bbebe6-58d6-4636-95bb-3217ef867c1a  (Power Saving Mode)
      Possible Setting Index: 000
      Possible Setting Friendly Name: Maximum Performance
      Possible Setting Index: 001
      Possible Setting Friendly Name: Low Power Saving
      Possible Setting Index: 002
      Possible Setting Friendly Name: Medium Power Saving
      Possible Setting Index: 003
      Possible Setting Friendly Name: Maximum Power Saving
    Current AC Power Setting Index: 0x00000000
    Current DC Power Setting Index: 0x00000000

  Subgroup GUID: 238c9fa8-0aad-41ed-83f4-97be242c8f20  (Sleep)
    GUID Alias: SUB_SLEEP
    Power Setting GUID: 29f6c1db-86da-48c5-9fdb-f2b67b1f44da  (Sleep after)
      GUID Alias: STANDBYIDLE
      Minimum Possible Setting: 0x00000000
      Maximum Possible Setting: 0xffffffff
      Possible Settings increment: 0x00000001
      Possible Settings units: Seconds
    Current AC Power Setting Index: 0x00000000
    Current DC Power Setting Index: 0x00000000

    Power Setting GUID: 94ac6d29-73ce-41a6-809f-6363ba21b47e  (Allow hybrid sleep)
      GUID Alias: HYBRIDSLEEP
      Possible Setting Index: 000
      Possible Setting Friendly Name: Off
      Possible Setting Index: 001
      Possible Setting Friendly Name: On
    Current AC Power Setting Index: 0x00000001
    Current DC Power Setting Index: 0x00000001

    Power Setting GUID: 9d7815a6-7ee4-497e-8888-515a05f02364  (Hibernate after)
      GUID Alias: HIBERNATEIDLE
      Minimum Possible Setting: 0x00000000
      Maximum Possible Setting: 0xffffffff
      Possible Settings increment: 0x00000001
      Possible Settings units: Seconds
    Current AC Power Setting Index: 0x00000000
    Current DC Power Setting Index: 0x00000000

    Power Setting GUID: bd3b718a-0680-4d9d-8ab2-e1d2b4ac806d  (Allow wake timers)
      GUID Alias: RTCWAKE
      Possible Setting Index: 000
      Possible Setting Friendly Name: Disable
      Possible Setting Index: 001
      Possible Setting Friendly Name: Enable
      Possible Setting Index: 002
      Possible Setting Friendly Name: Important Wake Timers Only
    Current AC Power Setting Index: 0x00000001
    Current DC Power Setting Index: 0x00000001

  Subgroup GUID: 2a737441-1930-4402-8d77-b2bebba308a3  (USB settings)
    Power Setting GUID: 48e6b7a6-50f5-4782-a5d4-53bb8f07e226  (USB selective suspend setting)
      Possible Setting Index: 000
      Possible Setting Friendly Name: Disabled
      Possible Setting Index: 001
      Possible Setting Friendly Name: Enabled
    Current AC Power Setting Index: 0x00000001
    Current DC Power Setting Index: 0x00000001

  Subgroup GUID: 4f971e89-eebd-4455-a8de-9e59040e7347  (Power buttons and lid)
    GUID Alias: SUB_BUTTONS
    Power Setting GUID: a7066653-8d6c-40a8-910e-a1f54b84c7e5  (Start menu power button)
      GUID Alias: UIBUTTON_ACTION
      Possible Setting Index: 000
      Possible Setting Friendly Name: Sleep
      Possible Setting Index: 001
      Possible Setting Friendly Name: Hibernate
      Possible Setting Index: 002
      Possible Setting Friendly Name: Shut down
    Current AC Power Setting Index: 0x00000000
    Current DC Power Setting Index: 0x00000000

  Subgroup GUID: 501a4d13-42af-4429-9fd1-a8218c268e20  (PCI Express)
    GUID Alias: SUB_PCIEXPRESS
    Power Setting GUID: ee12f906-d277-404b-b6da-e5fa1a576df5  (Link State Power Management)
      GUID Alias: ASPM
      Possible Setting Index: 000
      Possible Setting Friendly Name: Off
      Possible Setting Index: 001
      Possible Setting Friendly Name: Moderate power savings
      Possible Setting Index: 002
      Possible Setting Friendly Name: Maximum power savings
    Current AC Power Setting Index: 0x00000000
    Current DC Power Setting Index: 0x00000000

  Subgroup GUID: 54533251-82be-4824-96c1-47b60b740d00  (Processor power management)
    GUID Alias: SUB_PROCESSOR
    Power Setting GUID: 893dee8e-2bef-41e0-89c6-b55d0929964c  (Minimum processor state)
      GUID Alias: PROCTHROTTLEMIN
      Minimum Possible Setting: 0x00000000
      Maximum Possible Setting: 0x00000064
      Possible Settings increment: 0x00000001
      Possible Settings units: %
    Current AC Power Setting Index: 0x00000064
    Current DC Power Setting Index: 0x00000005

    Power Setting GUID: 94d3a615-a899-4ac5-ae2b-e4d8f634367f  (System cooling policy)
      GUID Alias: SYSCOOLPOL
      Possible Setting Index: 000
      Possible Setting Friendly Name: Passive
      Possible Setting Index: 001
      Possible Setting Friendly Name: Active
    Current AC Power Setting Index: 0x00000001
    Current DC Power Setting Index: 0x00000001

    Power Setting GUID: bc5038f7-23e0-4960-96da-33abaf5935ec  (Maximum processor state)
      GUID Alias: PROCTHROTTLEMAX
      Minimum Possible Setting: 0x00000000
      Maximum Possible Setting: 0x00000064
      Possible Settings increment: 0x00000001
      Possible Settings units: %
    Current AC Power Setting Index: 0x00000064
    Current DC Power Setting Index: 0x00000064

  Subgroup GUID: 7516b95f-f776-4464-8c53-06167f40cc99  (Display)
    GUID Alias: SUB_VIDEO
    Power Setting GUID: 3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e  (Turn off display after)
      GUID Alias: VIDEOIDLE
      Minimum Possible Setting: 0x00000000
      Maximum Possible Setting: 0xffffffff
      Possible Settings increment: 0x00000001
      Possible Settings units: Seconds
    Current AC Power Setting Index: 0x00000708
    Current DC Power Setting Index: 0x00000258

    Power Setting GUID: aded5e82-b909-4619-9949-f5d71dac0bcb  (Display brightness)
      Minimum Possible Setting: 0x00000000
      Maximum Possible Setting: 0x00000064
      Possible Settings increment: 0x00000001
      Possible Settings units: %
    Current AC Power Setting Index: 0x00000064
    Current DC Power Setting Index: 0x00000064

    Power Setting GUID: f1fbfde2-a960-4165-9f88-50667911ce96  (Dimmed display brightness)
      Minimum Possible Setting: 0x00000000
      Maximum Possible Setting: 0x00000064
      Possible Settings increment: 0x00000001
      Possible Settings units: %
    Current AC Power Setting Index: 0x00000032
    Current DC Power Setting Index: 0x00000032

    Power Setting GUID: fbd9aa66-9553-4097-ba44-ed6e9d65eab8  (Enable adaptive brightness)
      GUID Alias: ADAPTBRIGHT
      Possible Setting Index: 000
      Possible Setting Friendly Name: Off
      Possible Setting Index: 001
      Possible Setting Friendly Name: On
    Current AC Power Setting Index: 0x00000000
    Current DC Power Setting Index: 0x00000000

  Subgroup GUID: e73a048d-bf27-4f12-9731-8b2076e8891f  (Battery)
    GUID Alias: SUB_BATTERY
    Power Setting GUID: 5dbb7c9f-38e9-40d2-9749-4f8a0e9f640f  (Critical battery notification)
      GUID Alias: BATFLAGSCRIT
      Possible Setting Index: 000
      Possible Setting Friendly Name: Off
      Possible Setting Index: 001
      Possible Setting Friendly Name: On
    Current AC Power Setting Index: 0x00000001
    Current DC Power Setting Index: 0x00000001

    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: 0x00000002

    Power Setting GUID: 8183ba9a-e910-48da-8769-14ae6dc1170a  (Low battery level)
      GUID Alias: BATLEVELLOW
      Minimum Possible Setting: 0x00000000
      Maximum Possible Setting: 0x00000064
      Possible Settings increment: 0x00000001
      Possible Settings units: %
    Current AC Power Setting Index: 0x0000000a
    Current DC Power Setting Index: 0x0000000a

    Power Setting GUID: 9a66d8d7-4ff7-4ef9-b5a2-5a326ca2a469  (Critical battery level)
      GUID Alias: BATLEVELCRIT
      Minimum Possible Setting: 0x00000000
      Maximum Possible Setting: 0x00000064
      Possible Settings increment: 0x00000001
      Possible Settings units: %
    Current AC Power Setting Index: 0x00000005
    Current DC Power Setting Index: 0x00000005

    Power Setting GUID: bcded951-187b-4d05-bccc-f7e51960c258  (Low battery notification)
      GUID Alias: BATFLAGSLOW
      Possible Setting Index: 000
      Possible Setting Friendly Name: Off
      Possible Setting Index: 001
      Possible Setting Friendly Name: On
    Current AC Power Setting Index: 0x00000001
    Current DC Power Setting Index: 0x00000001

    Power Setting GUID: d8742dcb-3e6a-4b3c-b3fe-374623cdcf06  (Low battery action)
      GUID Alias: BATACTIONLOW
      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: 0x00000000
    Current DC Power Setting Index: 0x00000000

    Power Setting GUID: f3c5027d-cd16-4930-aa6b-90db844a8f00  (Reserve battery level)
      Minimum Possible Setting: 0x00000000
      Maximum Possible Setting: 0x00000064
      Possible Settings increment: 0x00000001
      Possible Settings units: %
    Current AC Power Setting Index: 0x00000007
    Current DC Power Setting Index: 0x00000007

Eu realmente não entendo nada disso...

Como posso usar um script para alterar automaticamente as opções de energia para as configurações postadas acima, pois não quero fazer isso manualmente?

windows-10 command-line
  • 2 2 respostas
  • 20524 Views

2 respostas

  • Voted
  1. silicontrip
    2021-07-06T18:12:09+08:002021-07-06T18:12:09+08:00

    As powercfgconfigurações não são muito difíceis de entender. Aqui estão minhas configurações de suspensão de exibição;

      Subgroup GUID: 7516b95f-f776-4464-8c53-06167f40cc99  (Display)
        GUID Alias: SUB_VIDEO
        Power Setting GUID: 3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e  (Turn off display after)
          GUID Alias: VIDEOIDLE
          Minimum Possible Setting: 0x00000000
          Maximum Possible Setting: 0xffffffff
          Possible Settings increment: 0x00000001
          Possible Settings units: Seconds
        Current AC Power Setting Index: 0x00000384
        Current DC Power Setting Index: 0x00000384
    

    As primeiras linhas contêm o identificador exclusivo da configuração.

    • O ID do grupo de exibição (começando com 751)
    • O ID para a configuração "Desligar exibição" (começando com 3c0)
    • Os valores máximo e mínimo permitidos para esta configuração mostrando entre o valor 0 e ffffffff.
    • A resolução para a configuração, neste caso, incrementos de 1.
    • A unidade que este valor está medindo, neste caso segundos.
    • As configurações atuais de CA e CC são definidas como 0x384, que em decimal é 900 segundos ou 15 minutos.

    Podemos definir os valores AC (ou DC) com o /SETACVALUEINDEX( ou /SETDCVALUEINDEX)

    • primeiro especificamos o esquema de configuração de energia (por GUID) que foi listado usando /lno seu caso, as configurações ativas são as configurações de alto desempenho, que possuem um GUID de:8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
    • Em seguida, especificamos o GUID do subgrupo, no meu caso, o GUID de configurações de exibição é:7516b95f-f776-4464-8c53-06167f40cc99
    • Seguido pelo GUID de configurações:3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e
    • Então o novo valor que queremos, isso pode ser decimal (ou hexadecimal com um 0x anterior)

    Este é o comando que você executaria para alterar as configurações de suspensão do monitor AC;

    powercfg /SETACVALUEINDEX fb5220ff-7e1a-47aa-9a42-50ffbf45c673 7516b95f-f776-4464-8c53-06167f40cc99 3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e 600

    Isso está usando os GUIDs da minha máquina, definindo o tempo limite de suspensão para 10 minutos (600 segundos)

    Você também pode usar os Aliases GUID conforme listado com o /qcomando;

    • SUB_VIDEOé alias para7516b95f-f776-4464-8c53-06167f40cc99
    • VIDEOIDLEé alias para3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e

    Presumo que esses nomes de alias sejam os mesmos em todas as máquinas. O esquema de energia não tem um alias. Então o comando seria;

    powercfg /SETACVALUEINDEX fb5220ff-7e1a-47aa-9a42-50ffbf45c673 SUB_VIDEO VIDEOIDLE 600

    • 3
  2. Best Answer
    Ξένη Γήινος
    2021-01-23T01:50:07+08:002021-01-23T01:50:07+08:00

    Não importa, eu resolvi isso, novamente (mais ou menos).

    Acabei de exportar a chave de registro inteira para um arquivo de registro chamado PowerCFG.reg localizado na área de trabalho usando regedit.exe.

    O arquivo é muito longo para ser postado aqui, e eu o converti para um arquivo ps1 que é ainda mais longo, eu os enviei para o Google Drive: PowerCFG.reg e PowerCFG_reg.ps1

    O arquivo de registro possui 9.232 linhas e 645.546 caracteres, o arquivo de script possui 3.491 linhas e 855.339 caracteres. Acho que posso importar o arquivo de registro.

    Entender os guids e hexes é muito difícil e vai custar muita energia, não é muito eficiente.

    No entanto, como todas as configurações são armazenadas nesta chave de registro:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power
    

    Simplesmente exportá-lo e importá-lo deve definir as configurações para o que eu quero que sejam, não preciso entender cada uma dessas chaves e valores, só preciso dizer ao computador para importar a chave.

    Confirmei, basta clicar duas vezes ou reg importnão importará corretamente as configurações, o acesso é negado;

    Então eu importei a chave por:

    psexec -S cmd /k reg import PowerCFG.reg
    

    Com o privilégio TrustedInstaller, o comando foi concluído com êxito sem erros.


    PS

    Tentar executar o arquivo _reg.ps1 gerará muitos erros como este:

    Set-ItemProperty: C:\Users\Estranger\Desktop\PowerCFG_reg.ps1:752
    Line |
     752 |  Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Power\ …
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | Cannot convert value "0xda7f5e8cbfe8964a9a85a6e23a8c635c" to type "System.Byte[]". Error: "Cannot
         | convert value "0xda7f5e8cbfe8964a9a85a6e23a8c635c" to type "System.Byte". Error: "Value was either too
         | large or too small for a UInt32.""
    

    Os infratores são valores REG_BINARY.

    • -1

relate perguntas

  • O serviço de arbitragem USB da estação de trabalho VMware não inicia automaticamente

  • Como ativar o sensor de impressão digital no domínio e no diretório ativo do Linux

  • atalho do shell da área de trabalho no painel lateral do explorer

  • Por que não consigo enviar arquivos do Android para o Windows 10?

  • Abrir com em vários arquivos?

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Como posso reduzir o consumo do processo `vmmem`?

    • 11 respostas
  • Marko Smith

    Baixar vídeo do Microsoft Stream

    • 4 respostas
  • Marko Smith

    O Google Chrome DevTools falhou ao analisar o SourceMap: chrome-extension

    • 6 respostas
  • Marko Smith

    O visualizador de fotos do Windows não pode ser executado porque não há memória suficiente?

    • 5 respostas
  • Marko Smith

    Como faço para ativar o WindowsXP agora que o suporte acabou?

    • 6 respostas
  • Marko Smith

    Área de trabalho remota congelando intermitentemente

    • 7 respostas
  • Marko Smith

    O que significa ter uma máscara de sub-rede /32?

    • 6 respostas
  • Marko Smith

    Ponteiro do mouse movendo-se nas teclas de seta pressionadas no Windows?

    • 1 respostas
  • Marko Smith

    O VirtualBox falha ao iniciar com VERR_NEM_VM_CREATE_FAILED

    • 8 respostas
  • Marko Smith

    Os aplicativos não aparecem nas configurações de privacidade da câmera e do microfone no MacBook

    • 5 respostas
  • Martin Hope
    Saaru Lindestøkke Por que os arquivos tar.xz são 15x menores ao usar a biblioteca tar do Python em comparação com o tar do macOS? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh Como posso reduzir o consumo do processo `vmmem`? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Pesquisa do Windows 10 não está carregando, mostrando janela em branco 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    v15 Por que uma conexão de Internet gigabit/s via cabo (coaxial) não oferece velocidades simétricas como fibra? 2020-01-25 08:53:31 +0800 CST
  • Martin Hope
    andre_ss6 Área de trabalho remota congelando intermitentemente 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney Por que colocar um ponto após o URL remove as informações de login? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension Ponteiro do mouse movendo-se nas teclas de seta pressionadas no Windows? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca Todos os meus complementos do Firefox foram desativados repentinamente, como posso reativá-los? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK É possível criar um código QR usando texto? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 Altere o nome da ramificação padrão do git init 2019-04-01 06:16:56 +0800 CST

Hot tag

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve