Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

Managing Power Settings with PowerShell and Batch Scripts in Windows

In today's technology-driven world, laptops have become an essential tool for many individuals. However, one common question that arises is whether it is safe to leave a laptop plugged in overnight. In this article, we will explore the power settings management options available in Windows, specifically using PowerShell and Batch Scripts, to ensure optimal power usage and extend the lifespan of your laptop's battery.

By default, Windows provides power plans that are designed to balance performance and energy consumption. These power plans include options such as Balanced, Power Saver, and High Performance. However, these default settings may not always align with the specific needs of every user. Adjusting the power settings can help optimize power usage, reduce energy consumption, and prevent unnecessary battery wear.

Examples:

  1. Changing Power Plan Settings with PowerShell:

    • Open PowerShell with administrative privileges.
    • Use the command powercfg -list to view the available power plans.
    • Identify the desired power plan and note its GUID.
    • Use the command powercfg -setactive <GUID> to set the desired power plan as active.
  2. Creating Custom Power Plans with Batch Scripts:

    • Open Notepad and create a new text file.
    • Use the following script as an example to create a custom power plan:
      @echo off
      powercfg -duplicatescheme <GUID> <Custom Power Plan Name>
      powercfg -setactive <GUID>
      powercfg -change -monitor-timeout-ac 0
      powercfg -change -monitor-timeout-dc 0
      powercfg -change -disk-timeout-ac 0
      powercfg -change -disk-timeout-dc 0
      powercfg -change -standby-timeout-ac 0
      powercfg -change -standby-timeout-dc 0
      powercfg -change -hibernate-timeout-ac 0
      powercfg -change -hibernate-timeout-dc 0
    • Save the file with a .bat extension.
    • Run the batch script with administrative privileges to create and activate the custom power plan.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.