Is it possible to Create Battery Saving Mode scenario in Windows 10 Desktop?

ramon_171 21 Reputation points
2022-05-04T07:50:21.92+00:00

I am developing a program that supposed to run every time the pc is running
The pc specification is have to be using Windows 10 OS

At the beginning I develop this program using Task Scheduler, and works fine
But since Task Scheduler has limitation like

  1. It cant run forever (https://stackoverflow.com/questions/71838536/why-does-netframework-console-exe-program-shut-down-by-itself-after-1-day-idle)
  2. When the PC is on Battery Saving mode, it won't started because the Task Scheduler that I create is just the basic one and does not fall into any of these criteria (https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/battery-saver)

We decided to move on to use Windows Service instead of Task Scheduler

It tackles the first problem,

However we have to make sure whether it is also worked on the 2nd problem as well

Currently We develop this program using Windows 10 on Desktop which has no "Battery option" in the configuration settings. Therefore I can't generate/create the 2nd scenario's environment.

I found that this guys is able to create a fake/simulation battery ( https://stackoverflow.com/questions/50658822/how-to-programmatically-emulate-battery-in-windows-workstation-without-battery-d)

However it doesnt worked for me because I am stuck at his step 6 because in my Target VM there are no C:\Program Files (x86)\Windows Kits\10\Testing\Runtimes\WDTF folder. Only C:\Program Files (x86)\Windows Kits\10\Testing\Runtimes\TAEF that exist.

  1. From virtual machine copy folder C:\Program Files (x86)\Windows Kits\10\Testing\Runtimes\WDTF\RunTime on your workstation

----
Question,

Is it worth to create the Fake Battery to Generate the "Battery Saving mode" scenario by following (https://stackoverflow.com/questions/50658822/how-to-programmatically-emulate-battery-in-windows-workstation-without-battery-d) ?

Or,

Is there any other way that I can do achieve the "Battery Saving Mode" scenario?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,129 questions
Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,619 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,506 Reputation points
    2022-05-04T22:33:42.473+00:00

    Hi @ramon_171

    Microsoft has not gotten around to exposing the battery-related functionality. You can use PowerSetActiveScheme to find some information regarding the battery saving mode but it might not help you in creating the exact scenario.

    You can try Setting Up the Test Environment and see if that can help you https://learn.microsoft.com/en-us/windows-server/identity/solution-guides/appendix-b--setting-up-the-test-environment

    How to Create a Test Environment https://learn.microsoft.com/en-us/microsoft-desktop-optimization-pack/medv-v2/how-to-create-a-test-environment

    ------------------

    --If the reply is helpful, please Upvote and Accept it as an answer--