Windows 10: Shut down computer when on battery Solved


  1. Posts : 3
    Windows 10 Home
       09 Jun 2017 #1

    Shut down computer when on battery


    Hello,

    I need to be able to shut down my ASUS R517S laptop whenever it is running on battery (which is internal and cannot be removed easily). OS: Windows 10 Home.

    Why? Working in a offshore environment with a "everything-should-shutdown-if-rig-loses-power-supply-policy".

    What i've tried so far: Change advanced power settings->Battery->Set low battery level to 100% and in low battery action set to shutdown if "On battery". This does not work - when i test and unplug the power chord, i only get a bluescreen with a "low battery" warning. After this it resumes to desktop and nothing happens (also tried sleep/hibernate options - but nothing is happening).

    Any ideas?
      My ComputerSystem Spec

  2.    09 Jun 2017 #2

    This does not seem straightforward although it seems simple. Do you not have an IT department responsible for your equipment?

    I don't believe there's a suitable task scheduler trigger.
      My ComputerSystem Spec


  3. Posts : 3
    Windows 10 Home
    Thread Starter
       09 Jun 2017 #3

    dalchina said: View Post
    This does not seem straightforward although it seems simple. Do you not have an IT department responsible for your equipment?

    I don't believe there's a suitable task scheduler trigger.
    This is my personal laptop, not company equipment. You are right, it cannot be automated from Windows task scheduler, currently investigating alternatives to that, but no luck yet
      My ComputerSystem Spec

  4.    09 Jun 2017 #4

    You could possibly trigger a shutdown from event id 327.

    If you switch your laptop to battery, noting the time, then look at your event log, you should be able to check that id.

    (I'd have thought if there's a company policy in a safety conscious environment, health and safety would have meant your company takes responsibility for all kit so it complies..)
      My ComputerSystem Spec

  5.    09 Jun 2017 #5

    The only thing I can think of is to write a script that constantly monitors / polls the computer to see if its using battery or not.

    Then if it is using battery issues the shutdown command.

    You'd place the script in the startup folder so it runs as soon as you boot.

    I guess you could look into using python or powershell to write this and look for a library that monitors the power useage... or put the question up on a coding site and offer some cash to get a student to write it.
      My ComputerSystem Spec

  6.    09 Jun 2017 #6

    This would be much easier and 'cleaner':
    Click image for larger version. 

Name:	Snap 2017-06-09 at 11.29.38.jpg 
Views:	1 
Size:	85.8 KB 
ID:	138661
    - assuming the event id is correct, and is generated on switching to battery.

    (There's some discussion here and there on this, so needs verification of course).

    Command e.g.
    shutdown.exe -s -t 00
    Shutdown
      My ComputerSystem Spec


  7. Posts : 3
    Windows 10 Home
    Thread Starter
       09 Jun 2017 #7

    dalchina said: View Post
    You could possibly trigger a shutdown from event id 327.

    If you switch your laptop to battery, noting the time, then look at your event log, you should be able to check that id.

    (I'd have thought if there's a company policy in a safety conscious environment, health and safety would have meant your company takes responsibility for all kit so it complies..)
    This might work, by running shutdown.exe, but i'm not sure how i can create a trigger just from event 327
      My ComputerSystem Spec

  •    09 Jun 2017 #8

    Set up a task as per my #6

    But first check the event id in Event Viewer as I suggested before
      My ComputerSystem Spec


  •  

    Related Threads
    Shut down computer in General Support
    Hello, Yesterday before going to bed, I went to shut-down the computer as always, it takes about 20-30 seconds. On screen had the usual notice something like 'shuting-down..', screen went black and I left the room. Then before going to bed I...
    Hi, Brand new computer from CyberPower PC, I've had it about a month or so now. SSD as the main drive for the OS and Programs. I think my other specs are in my profile. Anyway, booted up the computer this AM and was just browsing on line and...
    Hi, I click the windows10 icon and option comes; shut down. I press that one and I see stars going round the circle but computer doesn't shut down. Overnight it remained same. Next morning, I had to shut down manually. Why?
    I upgraded to Windows 10 from 7, everything went pretty smooth surprisingly, not perfect though. I was able to shut down my computer with 10 for some time, but all of a sudden the power button doesn't turn off. That is either through Start > Shut...
    Hello Friends! I was performing a Windows 10 upgrade from Windows 8 but it was not plugged to a power source. Before the upgrade could complete, it ran out of power. Now each time I turn it on it attempts an "automatic repair" which fails each...
    Our Sites
    Site Links
    About Us
    Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

    © Designer Media Ltd
    All times are GMT -5. The time now is 17:07.
    Find Us