0

I want to perform a scheduled task regardless of whether it is AC power or battery power. How can I achieve this via schtasks via parameters?

Compo
  • 30,301
  • 4
  • 20
  • 32
  • StackOverflow is dedicated to helping solve programming code problems. Your Q **may be** more appropriate for [su] , but read their help section regarding on-topic questions . AND please read [Help On-topic](https://stackoverflow.com/Help/On-topic) and [Help How-to-ask](https://stackoverflow.com/Help/How-to-ask) before posting more Qs here. Good luck. – shellter Oct 03 '20 at 14:50

1 Answers1

0

You can't: schtasks does not provide any parameters, you can use for checking where the power is coming from.

So, you need to launch the command either way, but inside that command, you can check for this, let me show you this example that you can use in case your command is a batchfile:

WMIC Path Win32_Battery Get BatteryStatus

This example is described in this other Stackoverflow post.

Dominique
  • 8,687
  • 9
  • 28
  • 67