Task Scheduler Help - Windows Server 2019

spicehead-klm 1 Reputation point
2020-11-05T19:43:14.41+00:00

My team and I have just upgraded to Windows Server 2019 from Windows Server 2008. We had the Task Scheduler running without issue on 2008, but now our tasks don't work on Server 2019 and I'm looking for some help!

I've been all over Google looking for an answer to this problem. I've changed from one-time trigger to daily trigger and back again. I've tried several different users, given full permission to them to access all of the folders. I've tried to run it and it just runs forever with no end.

To give you an example, we would like to run a weekly reboot of remote computers on our network and we're calling it Non-care Weekly Reboots:
37709-1.jpg

37710-2.jpg

37841-3.jpg

Program/script:
C:____________.bat

I've tried putting the Program/Script as just " ____.bat" and Start in: C:________\ . I've tried changing the C: to \ ____________.bat to have it reference the server it's on. I'm really at a loss.

This is the script we're running in specified .bat file.
37679-4.jpg

Is there anything anyone can see that needs to be corrected?

Thank you!

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,744 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Anonymous
    2020-11-05T19:46:23.417+00:00

    Might also check the logs.

    Event Viewer\Applications\Microsoft\Windows\TaskScheduler\Operational

    --please don't forget to Accept as answer if the reply is helpful--

    0 comments No comments

  2. MotoX80 33,556 Reputation points
    2020-11-06T13:45:23.203+00:00

    For Sysinternals utilities you need to add the /accepteula switch.

    Why don't you just use Windows shutdown.exe?

    0 comments No comments

  3. Anonymous
    2020-11-06T19:19:13.73+00:00

    The task isn't running at all

    I'd check the logs.

    Event Viewer\Applications\Microsoft\Windows\TaskScheduler\Operational

    --please don't forget to Accept as answer if the reply is helpful--

    0 comments No comments

  4. MotoX80 33,556 Reputation points
    2020-11-07T14:56:57.257+00:00

    You are not capturing the output of the programs being called by the .bat file. You are blindly executing the script and wondering why it doesn't work. You have to analyze the messages produced by the script and do basic computer troubleshooting.

    In the task scheduler, change the program/script field to:

    C:\xxxx\yyyy\zzzz.bat 1>C:\xxxx\Logs\zzzz.log 2>&1
    

    If you need to capture a log for each execution, add in the date+time. Be sure to put the file name in quotes because you may get a space in the hour value.

    C:\xxxx\yyyy\zzzz.bat 1>"C:\xxxx\Logs\zzzz.%date:~10,4%%date:~4,2%%date:~7,2%%time:~0,2%%time:~3,2%%time:~6,2%.log" 2>&1 
    

    http://steve-jansen.github.io/guides/windows-batch-scripting/part-4-stdin-stdout-stderr.html

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.