A way to pause apps when on battery?


Lamberto Vitali

Active member
Member
Local time
1:01 PM
Posts
337
OS
Windows 11 Professional (not the cut down rubbish)
I'm looking for a setting or app to allow me to pause certain apps (which are CPU/GPU intensive) when the system switches to battery.

This is a desktop, but it has a UPS. And although that UPS is two 130Ah motorhome batteries, I thought it would be wise to pause Sheepit/Folding@Home automatically, since it does also power the fridge, lights, stereo, TV, important stuff
:-)


Boinc will pause on battery, but the other two don't have that function built in. There must be a way Windows can pause a task? I thought about task scheduler, but all it has is "start a program", there are no other actions available.
 

My Computer

System One

  • OS
    Windows 11 Professional (not the cut down rubbish)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home built, of course
    CPU
    Ryzen 9 3900XT (on this one anyway, I have 8)
    Motherboard
    MSI X470 Gaming Plus Max
    Memory
    72G and 72GB and 64GB and 32GB and 32GB and 8GB and 8GB and 8GB
    Graphics Card(s)
    Fury and 12 Tahitis
    Sound Card
    People still use cards for those?
    Monitor(s) Displays
    7 of them.
    Screen Resolution
    All sorts.
    Hard Drives
    1TB NVME, 4TB rust spinner
    PSU
    Several kW
    Case
    Unimportant
    Cooling
    Big Zalman 6 inch thing
    Keyboard
    Really?
    Mouse
    Yes
    Internet Speed
    32Mbit/7Mbit
    Browser
    Opera
    Antivirus
    AVG
    Other Info
    [Crosses legs] Exactly what info are you looking for?
You say
Boinc will pause on battery,
I do not understand how it could.
To my way of thinking there is no way to stop a program from running in such a circumstance other than manually stopping it because there is no circuitry in a PC to differentiate between whether its power is coming from house power or inverter power.. When power is interrupted your inverter kicks in converting the dc voltage from your batteries to AC that powers the computer's power supply. What's more, the power supply doesn't care where its power is coming from as long as it is 120-volt AC power oscillating at 60 Hertz (I'm speaking of US power grid).
 
Last edited:

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 22631.3296
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 7080
    CPU
    i9-10900 10 core 20 threads
    Motherboard
    DELL 0J37VM
    Memory
    32 gb
    Graphics Card(s)
    none-Intel UHD Graphics 630
    Sound Card
    Integrated Realtek
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    1tb Solidigm m.2 +256gb ssd+512 gb usb m.2 sata
    PSU
    500w
    Case
    MT
    Cooling
    Dell Premium
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    so slow I'm too embarrassed to tell
    Browser
    Firefox
    Antivirus
    Defender+MWB Premium
  • Operating System
    Windows 10 Pro 22H2 19045.3930
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 9020
    CPU
    i7-4770
    Memory
    24 gb
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    256 gb Toshiba BG4 M.2 NVE SSB and 1 tb hdd
    PSU
    500w
    Case
    MT
    Cooling
    Dell factory
    Mouse
    Logitech wireless
    Keyboard
    Logitech wired
    Internet Speed
    still not telling
    Browser
    Firefox
    Antivirus
    Defender+MWB Premium
No, Windows acts like it's a laptop. The invertor has a USB link to the computer, telling it when the battery is in use, and how much is left.

1681013818543.png

The program Boinc already pauses itself when the computer goes onto battery. Any program can detect this, in the same way Windows can be set to dim the display, or sleep in a shorter time.

But I'm looking for a way to pause a program which doesn't have this function built in.

On this page, somebody had written a program to execute a program when going onto and off battery, but that program is no longer available, and I'd also need a way to pause a program. Is there a way to execute a program on power events?

I also found "battery saver" built into Windows, and you can make it stop "background apps" running, but if it's not classed as a background app, it won't do anything with it.
 
Last edited:

My Computer

System One

  • OS
    Windows 11 Professional (not the cut down rubbish)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home built, of course
    CPU
    Ryzen 9 3900XT (on this one anyway, I have 8)
    Motherboard
    MSI X470 Gaming Plus Max
    Memory
    72G and 72GB and 64GB and 32GB and 32GB and 8GB and 8GB and 8GB
    Graphics Card(s)
    Fury and 12 Tahitis
    Sound Card
    People still use cards for those?
    Monitor(s) Displays
    7 of them.
    Screen Resolution
    All sorts.
    Hard Drives
    1TB NVME, 4TB rust spinner
    PSU
    Several kW
    Case
    Unimportant
    Cooling
    Big Zalman 6 inch thing
    Keyboard
    Really?
    Mouse
    Yes
    Internet Speed
    32Mbit/7Mbit
    Browser
    Opera
    Antivirus
    AVG
    Other Info
    [Crosses legs] Exactly what info are you looking for?
Sorry, I was going by the way my line interactive UPS works. (or how I think it works)
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 22631.3296
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 7080
    CPU
    i9-10900 10 core 20 threads
    Motherboard
    DELL 0J37VM
    Memory
    32 gb
    Graphics Card(s)
    none-Intel UHD Graphics 630
    Sound Card
    Integrated Realtek
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    1tb Solidigm m.2 +256gb ssd+512 gb usb m.2 sata
    PSU
    500w
    Case
    MT
    Cooling
    Dell Premium
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    so slow I'm too embarrassed to tell
    Browser
    Firefox
    Antivirus
    Defender+MWB Premium
  • Operating System
    Windows 10 Pro 22H2 19045.3930
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 9020
    CPU
    i7-4770
    Memory
    24 gb
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    256 gb Toshiba BG4 M.2 NVE SSB and 1 tb hdd
    PSU
    500w
    Case
    MT
    Cooling
    Dell factory
    Mouse
    Logitech wireless
    Keyboard
    Logitech wired
    Internet Speed
    still not telling
    Browser
    Firefox
    Antivirus
    Defender+MWB Premium
Mine is line interactive too (offline ones simply power the computer during a powercut and otherwise run the computer directly from the mains, interactive ones also adjust low or high voltage through a transformer, online ones always uses the invertor to create power cleanly so nothing can get through like spikes or interference). The only change I made was to remove it's internal battery and connect two huge motorhome batteries outside it via 0 guage wires (the thick kind you find in your car connected to the battery). This makes it last for hours at full 1000W load. Unless you have a very cheap UPS, there will most likely be a USB socket on the back. Connect a lead from there to your computer, and it will show the battery status in the system tray, just like a laptop does. This means the computer can act when it changes to battery, or when it's running low. For example mine sleeps at 20% and hibernates at 10%.
 

My Computer

System One

  • OS
    Windows 11 Professional (not the cut down rubbish)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home built, of course
    CPU
    Ryzen 9 3900XT (on this one anyway, I have 8)
    Motherboard
    MSI X470 Gaming Plus Max
    Memory
    72G and 72GB and 64GB and 32GB and 32GB and 8GB and 8GB and 8GB
    Graphics Card(s)
    Fury and 12 Tahitis
    Sound Card
    People still use cards for those?
    Monitor(s) Displays
    7 of them.
    Screen Resolution
    All sorts.
    Hard Drives
    1TB NVME, 4TB rust spinner
    PSU
    Several kW
    Case
    Unimportant
    Cooling
    Big Zalman 6 inch thing
    Keyboard
    Really?
    Mouse
    Yes
    Internet Speed
    32Mbit/7Mbit
    Browser
    Opera
    Antivirus
    AVG
    Other Info
    [Crosses legs] Exactly what info are you looking for?
You taught me something. Yes it has several usb ports but the only thing I've ever used them for is charging during a power outage. We were hit by a tornado last Nov and were without power for 13 days with nothing but our phones and my ipad. That's really been the only time I relied on it very much, but it was a godsend. The main reason I got it was we live in a rural area and the smallest storm makes our main power flicker on and off a lot. I've always felt the UPS adds to protecting my equipment until I can get everything turned off and disconnected which I always do when a storm hits that has a lot of electrical activity.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 22631.3296
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 7080
    CPU
    i9-10900 10 core 20 threads
    Motherboard
    DELL 0J37VM
    Memory
    32 gb
    Graphics Card(s)
    none-Intel UHD Graphics 630
    Sound Card
    Integrated Realtek
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    1tb Solidigm m.2 +256gb ssd+512 gb usb m.2 sata
    PSU
    500w
    Case
    MT
    Cooling
    Dell Premium
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    so slow I'm too embarrassed to tell
    Browser
    Firefox
    Antivirus
    Defender+MWB Premium
  • Operating System
    Windows 10 Pro 22H2 19045.3930
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 9020
    CPU
    i7-4770
    Memory
    24 gb
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    256 gb Toshiba BG4 M.2 NVE SSB and 1 tb hdd
    PSU
    500w
    Case
    MT
    Cooling
    Dell factory
    Mouse
    Logitech wireless
    Keyboard
    Logitech wired
    Internet Speed
    still not telling
    Browser
    Firefox
    Antivirus
    Defender+MWB Premium
If there's a USB port for communicating with the PC, presumably it will be a different shaped socket. Mine looks like this (like a printer socket):

iu

I've got two phone-shaped batteries I use to charge stuff when on holiday (or I guess if I had a powercut, they virtually never happen here). They will also jump start a car with a dead battery (which is what I've used them for most (it's a 21 year old car!)

maypole-mp7429.jpg

If I had powercuts as long as you, I'd buy more motorhome batteries. The batteries in a UPS are stupidly expensive and don't last more than half an hour. I got my UPS for $35 with no batteries second hand. The two motorhome batteries cost $160 for the pair, and last 10 times longer than what would have come with the UPS.

What did you power your fridge from?
 

My Computer

System One

  • OS
    Windows 11 Professional (not the cut down rubbish)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home built, of course
    CPU
    Ryzen 9 3900XT (on this one anyway, I have 8)
    Motherboard
    MSI X470 Gaming Plus Max
    Memory
    72G and 72GB and 64GB and 32GB and 32GB and 8GB and 8GB and 8GB
    Graphics Card(s)
    Fury and 12 Tahitis
    Sound Card
    People still use cards for those?
    Monitor(s) Displays
    7 of them.
    Screen Resolution
    All sorts.
    Hard Drives
    1TB NVME, 4TB rust spinner
    PSU
    Several kW
    Case
    Unimportant
    Cooling
    Big Zalman 6 inch thing
    Keyboard
    Really?
    Mouse
    Yes
    Internet Speed
    32Mbit/7Mbit
    Browser
    Opera
    Antivirus
    AVG
    Other Info
    [Crosses legs] Exactly what info are you looking for?
How's your scripting/programming skills?

You could use a self written AutoIT Script to detect the power event and then control each app individually. You can even program virtual mouse moves and clicks using this method.

Look into this, if you can't find another solution.

 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 build 10.0.22631.3296 (Release Channel) / Linux Mint 21.3 Cinnamon
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo A485
    CPU
    Ryzen 7 2700U Pro
    Motherboard
    Lenovo (WiFi/BT module upgraded to Intel Wireless-AC-9260)
    Memory
    32GB
    Graphics Card(s)
    iGPU Vega 10
    Sound Card
    Realtek
    Monitor(s) Displays
    14" FHD (built-in) + 14" Lenovo Thinkvision M14t (touch+pen) + 32" Asus PB328
    Screen Resolution
    FHD + FHD + 1440p
    Hard Drives
    Intel 660p m.2 nVME PCIe3.0 x2 512GB
    PSU
    65W
    Keyboard
    Thinkpad / Logitech MX Keys
    Mouse
    Logitech MX Master 2S
    Internet Speed
    600/300Mbit
    Browser
    Edge (Chromium)
    Antivirus
    Windows Defender
    Other Info
    SecureBoot: Enabled
    TPM2.0: Enabled
    AMD-V: Enabled
  • Operating System
    Windows 11 Pro 23H2 build 10.0.22631.3296(Release Preview Channel)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom
    CPU
    i7-7700k @4.8GHz
    Motherboard
    Asus PRIME Z270-A
    Memory
    32GB 2x16GB 2133MHz CL15
    Graphics card(s)
    EVGA GTX1080Ti FTW 11GB
    Sound Card
    Integrated
    Monitor(s) Displays
    32" 10-bit Asus PB328Q
    Screen Resolution
    WQHD 2560x1440
    Hard Drives
    512GB ADATA SX8000NP NVMe PCIe Gen 3 x4
    PSU
    850W
    Case
    Fractal Design Define 7
    Cooling
    Noctua NH-D15 chromax.black
    Mouse
    Logitech MX Master 2S
    Keyboard
    Logitech MX Keys
    Internet Speed
    600/300Mbit
    Browser
    Edge (Cromium)
    Antivirus
    Windows Defender
    Other Info
    AC WiFi Card
What did you power your fridge from?
Normally our power is never off more than a few hours at a time, mostly just spikes and surges. We've only been out of power that long twice in 15 years, once an ice storm caused trees to damage power lines all over the county. It was so cold that time, all we had to do was put refrigerated stuff outside or in the garage. This last time the tornado ripped power poles in its path out of the ground and trees fell everywhere breaking lines and poles.
This time a friend brought us a small generator to power enough of our appliances that we could survive. It wouldn't have done us any good to power our electronics as our ISP tower was laying on the ground for 27 days and & our satellite dish was ripped off the house. All we had was our cell phones but signal wasn't strong enough to do much more than make a call since a number of cell towers were damaged. But having electronics was the least of our problem.
We had huge trees completely uprooted and still have holes big enough you could almost bury a car. All in all we lost about 80 trees.
We couldn't even get out of our driveway for 3 days as our neighbors horse barn was sitting in the middle of it.
Our house had/has a lot of damage but at least it's still standing. Many of our neighbors lost everything. Debris cleanup has been so much fun...and expensive...as it's not covered by insurance. Most people don't know that little fact. We didn't.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 22631.3296
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 7080
    CPU
    i9-10900 10 core 20 threads
    Motherboard
    DELL 0J37VM
    Memory
    32 gb
    Graphics Card(s)
    none-Intel UHD Graphics 630
    Sound Card
    Integrated Realtek
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    1tb Solidigm m.2 +256gb ssd+512 gb usb m.2 sata
    PSU
    500w
    Case
    MT
    Cooling
    Dell Premium
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    so slow I'm too embarrassed to tell
    Browser
    Firefox
    Antivirus
    Defender+MWB Premium
  • Operating System
    Windows 10 Pro 22H2 19045.3930
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 9020
    CPU
    i7-4770
    Memory
    24 gb
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    256 gb Toshiba BG4 M.2 NVE SSB and 1 tb hdd
    PSU
    500w
    Case
    MT
    Cooling
    Dell factory
    Mouse
    Logitech wireless
    Keyboard
    Logitech wired
    Internet Speed
    still not telling
    Browser
    Firefox
    Antivirus
    Defender+MWB Premium
How's your scripting/programming skills?

Nil.
You could use a self written AutoIT Script to detect the power event and then control each app individually. You can even program virtual mouse moves and clicks using this method.

Look into this, if you can't find another solution.

 

My Computer

System One

  • OS
    Windows 11 Professional (not the cut down rubbish)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home built, of course
    CPU
    Ryzen 9 3900XT (on this one anyway, I have 8)
    Motherboard
    MSI X470 Gaming Plus Max
    Memory
    72G and 72GB and 64GB and 32GB and 32GB and 8GB and 8GB and 8GB
    Graphics Card(s)
    Fury and 12 Tahitis
    Sound Card
    People still use cards for those?
    Monitor(s) Displays
    7 of them.
    Screen Resolution
    All sorts.
    Hard Drives
    1TB NVME, 4TB rust spinner
    PSU
    Several kW
    Case
    Unimportant
    Cooling
    Big Zalman 6 inch thing
    Keyboard
    Really?
    Mouse
    Yes
    Internet Speed
    32Mbit/7Mbit
    Browser
    Opera
    Antivirus
    AVG
    Other Info
    [Crosses legs] Exactly what info are you looking for?
Normally our power is never off more than a few hours at a time, mostly just spikes and surges. We've only been out of power that long twice in 15 years, once an ice storm caused trees to damage power lines all over the county. It was so cold that time, all we had to do was put refrigerated stuff outside or in the garage. This last time the tornado ripped power poles in its path out of the ground and trees fell everywhere breaking lines and poles.
This time a friend brought us a small generator to power enough of our appliances that we could survive.
Sounds fun. But you don't actually need appliances to survive, you just live like the Amish, or like everyone did a few hundred years ago.
 

My Computer

System One

  • OS
    Windows 11 Professional (not the cut down rubbish)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home built, of course
    CPU
    Ryzen 9 3900XT (on this one anyway, I have 8)
    Motherboard
    MSI X470 Gaming Plus Max
    Memory
    72G and 72GB and 64GB and 32GB and 32GB and 8GB and 8GB and 8GB
    Graphics Card(s)
    Fury and 12 Tahitis
    Sound Card
    People still use cards for those?
    Monitor(s) Displays
    7 of them.
    Screen Resolution
    All sorts.
    Hard Drives
    1TB NVME, 4TB rust spinner
    PSU
    Several kW
    Case
    Unimportant
    Cooling
    Big Zalman 6 inch thing
    Keyboard
    Really?
    Mouse
    Yes
    Internet Speed
    32Mbit/7Mbit
    Browser
    Opera
    Antivirus
    AVG
    Other Info
    [Crosses legs] Exactly what info are you looking for?
Back
Top Bottom