Task scheduler- task completed "successfully" with exit code 0x8007001

  1. Posts : 18
    Windows 10 1709

    Task scheduler- task completed "successfully" with exit code 0x8007001

    I am running a daily task which is supposed to
    - wake the computer from hibernation
    - copy a file to a network drive, and create a log file
    - shutdown the computer

    When starting the task manually from within the task scheduler, everything is executed as intended.

    When leaving the computer in hibernation mode, the task scheduler wakes the computer at the specified time, but apparently the command file (.cmd) ist not executed at all. No log file ist created, no file is copied, and the computer is not shut down. The task is marked as "successfully completed with the return code 0x80070001" displayed in decimal (2147942401).
    This error code seems to indicate an "illegal function", but I have no clue what that might be, especially since the task runs fine when started manually, as said.

    Any hint highly appreciated, questions welcome.
      My Computer

  2. Posts : 42,955
    Win 10 Pro (22H2) (2nd PC is 22H2)

    Hi, suggest you take the problem apart.
    1. Schedule a task to resume from hibernation but to do something simple like execute a bat file to display a message or open file explorer, timed to run while you are there.
    2. Check this runs ok.
    3. When this works satisfactorily, add your command to the bat file.
    4. Check the result.
    Check the result.

    Note: you say no log file is created, but presumably there would be a report in the event log.
    You might get further info from that (event viewer).

    Another thought- as you are using a network, if, say, your scheduled task is run overnight, is there anything differently configured then?
      My Computers

  3. Posts : 18
    Windows 10 1709
    Thread Starter

    As a matter of fact I have another task running weekly and reliably at night with the same task settings (different actions and trigger), and accessing the same NAS. Which is why I'm puzzled. No changes to the network at any time.
    I'm not sure how to use the event viewer, a hint woud be great.
    Thx and cheers, Steinspecht
      My Computer

  4. Posts : 42,955
    Win 10 Pro (22H2) (2nd PC is 22H2)

    Hi, so the differences between the two tasks may suggest ways to take the problem apart.
    For example, do both resume from hibernation?

    Howtogeek is a useful site:
    What Is the Windows Event Viewer, and How Can I Use It?
    Windows Admin: Using Event Viewer to Troubleshoot Problems
    How to Create Your Own Windows Event Log Notification System
    Look Up Event IDs from the Event Viewer Using a Free Tool
      My Computers

  5. Posts : 18
    Windows 10 1709
    Thread Starter

    I appreciate the notion of taking a problem apart. However, as said, the two tasks differ only in the actions (i.e., different commad scripts) and triggers (different execution times). Both start at the specified times which I can see in the scheduler protocol. One executes the command script, the other one does not. I can tell because both command scripts redirect their output to a log file. One does what it's supposed to (i.e. a weekly backup), the other does not (I.e. copyying a file each night). It still records the task as successfully completed with the return code mentioned in my initial post. If I only knew what exactly it means. Web research only mentions it in the connection with Windows backup and restore, something my command script doesn't invoke.

    I shall now look at the links you provided - thanks a lot!
      My Computer

  6. Posts : 18
    Windows 10 1709
    Thread Starter

    Back after a while in frustration.
    I couldn't find anything suspicious in the event viewer at or around the times the task was started. There are some informational things recorded about "Music.UI (9036) {7FAAB28B-5CC2-407F-BD83-28FE53F0BA3C}:" and a protocol file C:\Users\Andrei\AppData\Local\Packages\Microsoft.ZuneMusic_8wekyb3d8bbwe\LocalState\Database\anonymo us\edb.log", apparently about a database module doing something about a logfile (I don't use MicrosoftZuneMusic and have no idea what this is!).

    The error message in my first posting header should read "0x80070001", one zero was missing there.

    Still no clue what to look for.
      My Computer

  7. Posts : 42,955
    Win 10 Pro (22H2) (2nd PC is 22H2)

    Have you tried what I suggested in #2?
      My Computers

  8. Posts : 18
    Windows 10 1709
    Thread Starter

    Yes this all works. But not when re-activating the computer shortly after midnight via the task scheduler. It looks like cmd.exe ist never started, therefore the comand script is not run. Then I get this weird return code.

    Do you know anything about it? That is the only question I have.
      My Computer

  9. Posts : 42,955
    Win 10 Pro (22H2) (2nd PC is 22H2)

    My guess is you might need a delay. Beyond that I'll leave it to someone else. Good luck!
      My Computers

  10. Posts : 18
    Windows 10 1709
    Thread Starter

    the script has a delay of 3 minutes, but what use if it never runs. how do i delay starting a job in the scheduler which is set to start at time x??
      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 03:10.
Find Us

Windows 10 Forums