Git Product home page Git Product logo

tempdisablepowersettings's Introduction

Temporarily disable PowerPlan settings

When processing data for long time your Computer might go into hibernation or shut down depending on your power settings. Same for closing the Lid on a Laptop. This code can temporarily disable PowerPlan settings while the script is running.

Laptops can switch and hide PowerPlans when plugged in or in battery mode that's why all PowerPlans can be adjusted at once to avoid unecpected behavior when unplugging. PowerCFG adjusts settings per plan not all PowerPlans at once. If disabling hibernation on the current active PowerPlan on a Laptop and then unplugging it, your Laptop might still go into hibernation on the battery plan and cancel your processing.

Versions

  • Verbose has a bunch of feedback added that are purely informative not functional.
  • Minimized reduced to a more barebones version which is easy to include in your own scripts. However also less readable since some parts are also reduced to one line.
  • LidOnly reduced to only adjust the LidClose Action.

Some additional notes

  • PowerCFG does not list hidden plans but can edit them. CIM/WIM can neither list or edit them.
  • PowerCFG allows for individual Plan editing which causes confusion since computers can switch PowerPlans automatic.
  • Windows user interface PowerButton and Lid close actions are applied to all Powerplans not individually.
  • PowerCFG can randomly be incredibly slow and take around 3sec to spit out a response. I didn't figure out what can cause it and only a reboot seemed to fix it.
  • PowerPlans are on purpose collected via the Registry directly since PowerCFG and CIM/WIM do not list hidden Plans.
  • The Verbose version of the script is checking via WMI if a Laptop is plugged in because the CIM alternative is (suprisingly) about 5x slower in this case.

Disclaimer

The scripts works fine on my Win10 ROG Laptop. I cannot tell or know how other Windows versions might need some adjusting. You might have to edit the Registry location or change the string handling yourself.

tempdisablepowersettings's People

Contributors

akarcode avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.