Windows 10 Task Scheduler will not run batch files

schmieg

Extraordinary Member
Beginning about four days ago, all three of my Windows 10 machines stopped running batch files scheduled in the Task Scheduler. These batch files had been running on schedule for over a year when all three suddenly stopped about the same time. I believe that this is about the time that the September 2020 Preview Cumulative Update installed. Task Scheduler reports that "Access is denied. (0x80070005). I have tried running them directly as batch files and running "c:\windows\system32\cmd.exe" with the arguments "/c c:\bt\filename.bat" and both fail. I do have the starting directory shown as "c:\bt." All quotation marks are just to separate the commands from the rest of my message and do not appear in the boxes. I did an image restore from October 1 and brought my files up to date, and everything worked again until the update reinstalled itself. I could do the same thing again and postpone the updates, but, sooner or later, the update will be forced upon me and I would like to find a solution to this. Besides, it is very time consuming to restore and bring three systems back up to current data.

I've been playing with this now for three days and I'm at a loss. I've run SFC /scannow with no results and I also ran DISM to try to fix the Task Scheduler. I did try to go back to a previous System Restore and that failed. Whereto from here?
 
Are they running with higher privileges? Does the running account have rights to run as a batch job?
 
NeeMobeer. Yes to both of your questions. These batch files have been running on all three computers for over a year now until the 5th of this month.

I will add that I have found a workaround, though not a fix. I went looking through my collection of utility programs and found Elevate64.exe which will elevate a command prompt to a new window at elevated permissions. Since this is an executable file, Task Scheduler will run it. This little utility will also run a program or a batch file in the elevated window, so I made the program to run c:\ut\elevate64.exe and added the arguments -wait4idle -noui c:\bt\update2x.bat. The -wait4idle closes the scheduled task while the utility created task continues to run. The -noui just tells the utility not to issue notifications. It works perfectly, but I would still like to find a fix to the original problem.
 
Batch files run from task scheduler don't require the cmd /c part. You can just specific the full path to the batch file as the program to run. .bat shell extension tells it how to run it.
 
Back
Top