0

I made a batch file that creates an auto shutdown task in taskschd.msc which is supposed to shutdown the computer at a certain hour each day.

The said batch:

@echo off
SCHTASKS /Create /SC DAILY /TN "Auto Shutdown" /ST 20:00:00 /TR "C:\Windows\System32\shutdown.exe /s /f /t 000"

In some of the machines i deployed the batch file the shutdown was successful while in others i got the following error message and the machine did not turn off.

The Task Scheduler can not start the "Auto Shutdown" task for the user "LOCAL \ admin". Additional data: error value: 2147943645.

Any kind of help is greatly appreciated and thank you for your time.

  • 1
    Is run with highest privileges checked? This is required on some systems. – LPChip Mar 27 '18 at 14:40
  • It's not, is there a way to add that feature the batch file? – Minnen Mar 27 '18 at 14:46
  • 1
    @Minnen yes, you have to pass a username and password in like this, along with the /rl highest flag. SCHTASKS /Create /TN "New Task" /SC HOURLY /TR blah.exe /RU username /RP password /RL HIGHEST – Narzard Mar 27 '18 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.