Windows 10 Pro rel. 2004 Task Scheduler suddenly stopped running batch

Page 1 of 2 12 LastLast

  1. Posts : 15
    Windows 10 Pro
       #1

    Windows 10 Pro rel. 2004 Task Scheduler suddenly stopped running batch


    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?
      My Computers


  2. Posts : 36,363
    Win 10 Pro (21H2) (2nd PC is 21H2)
       #2

    Hi, great that you use imaging and are acting defensively.

    There are various ways to block individual updates, frequently described here.
    sooner or later, the update will be forced upon me
    - you don't have to have this experience.

    a. You have Pro so you can set updates to Notify in Group Policy. Thus no update is forced upon you. You are notified and have to apporove it.
    b. You can hide (block) a particular update.
    MS's method:
    Hide or Show Windows Updates in Windows 10

    More convenient: a 3rd party tool such as
    WuMgr is a free open-source Update Manager for Windows 10
    - scan, select and hide the update

    Is the effect of this update reversed if you uninstall it?

    Which is the update? KB........
    Thanks.
      My Computers


  3. Posts : 15
    Windows 10 Pro
    Thread Starter
       #3

    I have removed the update with no change and I reinstalled it with no change. It seems that restoring the old version is the only thing that works at this time. I did change one of the batch file tasks to an executable file with no other changes to the task and that ran perfectly. I also created a task that would just open the command prompt and that did not work, so it appears that Task Manager cannot open cmd.exe which would explain the batch file failure.

    - - - Updated - - -

    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.
      My Computers


  4. Posts : 12,007
    Windows 10 Home x64 Version 21H2 Build 19044.1826
       #4

    1 Has Windows defender quarantined or deleted anything relevant?

    2.1 If, as you say,
    I have tried running them directly as batch files and ... and both fail
    then the batch file itself is not working properly and you could add a Pause line at the end of it so you can look through to see where it is going wrong.
    2.2 Perhaps the batch file calls an external item that is no longer installed / in the expected location?

    3.1 Have you had any problems with logging in?
    3.2 If, in a command window, you enter
    whoami
    do you get the expected response?
    [The format of the response is ComputerName\UserName]

    Denis
      My Computer


  5. Posts : 15
    Windows 10 Pro
    Thread Starter
       #5

    Try3 said:
    1 Has Windows defender quarantined or deleted anything relevant?
    No.

    2.1 If, as you say,
    I have tried running them directly as batch files and ... and both fail
    then the batch file itself is not working properly and you could add a Pause line at the end of it so you can look through to see where it is going wrong.
    The batch files work if called from the command prompt or Windows Explorer. They don't work if the batch file is used as the task to be run, nor does cmd.exe work if used as the task to be run with the batch file as the argument.
    2.2 Perhaps the batch file calls an external item that is no longer installed / in the expected location?
    All external items in the batch files are present and work properly if run outside of Task Manager.
    3.1 Have you had any problems with logging in?
    No. I tried switching to a local logon instead of the Microsoft logon, but that made no difference.
    3.2 If, in a command window, you enter
    whoami
    do you get the expected response?
    [The format of the response is ComputerName\UserName]
    Yes.
    My last post above details my workaround, but the problem is that it won't run anything except executables.
      My Computers


  6. Posts : 12,007
    Windows 10 Home x64 Version 21H2 Build 19044.1826
       #6

    Perhaps Task scheduler, <this task>, History tab says something useful other than the Access is denied you referred to?
    [assuming you have used the Enable all tasks history control on the right-hand side]

    Event viewer TS task records are at
    Log - Microsoft-Windows-TaskScheduler/Operational
    Source - TaskScheduler

    I think, from what you have said, that you tested an .exe that was in the same C:\bt folder as your batch files so we can discount folder access being an issue.

    Denis
      My Computer



  7. Posts : 15
    Windows 10 Pro
    Thread Starter
       #7

    This doesn't tell me anything, but it might tell you something:

    Windows 10 Pro rel. 2004 Task Scheduler suddenly stopped running batch-image.png

    The executable is not in the same directory as the batch file and neither directory is in the default path of the system.
      My Computers


  8. Posts : 12,007
    Windows 10 Home x64 Version 21H2 Build 19044.1826
       #8

    Try a test of opening a text file in C:\bt so you can find out if it is a folder access problem.
    Windows 10 Pro rel. 2004 Task Scheduler suddenly stopped running batch-screenshot-1969-.png

    Is the task running under the user's privileges or elevated?
    - If just using the user's privileges then use that for the test task.
    - If elevated then try the test task elevated and then again just using user's privileges

    Denis
      My Computer


  9. Posts : 15
    Windows 10 Pro
    Thread Starter
       #9

    I opens the text file, but it uses Notepad to do so. It works either under both the regular and elevated settings. Again, I see no cmd.exe involvement here.
      My Computers


  10. Posts : 12,007
    Windows 10 Home x64 Version 21H2 Build 19044.1826
       #10

    schmieg said:
    I opens the text file, but it uses Notepad to do so. It works either under both the regular and elevated settings. Again, I see no cmd.exe involvement here.
    Try3 said:
    Try a test of opening a text file in C:\bt so you can find out if it is a folder access problem.
    I wasn't trying to assess anything to do with cmd.exe

    I cannot think of any other tests to identfy the cause of the problem.

    Denis
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 19:33.
Find Us




Windows 10 Forums