Giter Club home page Giter Club logo

neverwake's Introduction

NeverWake

  • Stop Windows from randomly waking up from sleep.
  • Stop Windows from killing your laptop by trying to install updates in your backpack.
  • Stop Windows from waking you up at night by spinning your gamer fans to 100.

Update for those who want to disable wakeups through configs

It's been a couple days since the last time the script has had to resleep. To recap:

  • Use powercfg -lastwake to see why your pc is on. If its Power Button than you have a hardware issue (ex: laptop is getting jostled enough in your bag to wake up)
  • Ensure powercfg /devicequery wake_armed is empty
  • In Task Scheduler LibraryMicrosoftWindowsUpdateOrchestrator, make sure none of the tasks are set to Wake the computer to run this task
  • Disable wake timers in advanced power settings
  • Disable hibernating after x minutes in advanced power settings as suggested by concrete_d

Does What?

Simple script that sends your PC back to sleep if the wakeup source was not Power Button. For me, powercfg -lastwake always reports the wake source as Power Button regardless of if its opening the lid, mashing the keyboard, or doing exactly that. If yours reports something different, make an issue/pull request and I'll add it as one of the acceptable wakeup reasons.

How to Install

  1. Sleep your pc and wake it up again.
  2. Download the PsShutdown utility from Microsoft and add it to the %PATH%.
  3. Run Test.bat to make sure everything is ok. Failure to do so may result in a semi boot loop. Fixable, but obnoxious
  4. Open the event viewer. Windows logs -> System -> Find the Power-Troubleshooter event indicating your PC woke up from sleep.
  5. Right-click -> Attach task to this event.
  6. For the action, do Start a Program and browse for NeverWake.bat
  7. Check Open the properties dialog when I click Finish
  8. Check Run whether user is logged on or not
  9. Under conditions, uncheck Start the task only if computer is on AC power and hit OK.
  10. Done. Your PC should now go back to sleep if a Windows service or any other program wakes it up.

How do I know it works?

  1. Enable all task history
  2. Click on an Action Completed event
  3. View the exit code. 0 = nothing 1 = resleep Image of task scheduler with locations marked out

Help! Computer always sleeps when I wake it up

To fix this you either have to boot into safe mode or just power down and restart your pc completely (as a cold boot will not fire the power-troubleshooter event).

neverwake's People

Contributors

cooldotty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.