Task scheduler- task completed “successfully” with exit code 0x8007001












0














I am running a daily task on Windows 10 Pro which is supposed to




  • wake the computer from hibernation

  • start cmd.exe, run a command script to copy a file to a network drive, 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 2147942401" which is hex 0x80070001.
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.



Here's an overview of the task settings (translated from German, but it should be clear):




  • General:
    execute regardless of user login; don't store password; highest privileges; configured for Windows 10


  • Actions: start program cmd.exe; arguments: /c "path-to-cmd-scriptscript.cmd >> logfile.txt"; start in: empty


  • Conditions: reactivate computer


  • Settings: allow execution if needed; if execution fails restart every 10 minutes; end task if execution longer than 3 days; force ending of active task if not stopped on request; don't start new instance



I have another task doing a backup with exactly the same setting which is running fine (wakes up, runs a script, then shuts down computer).



Any hint highly appreciated, questions welcome.










share|improve this question






















  • "start in: empty" does script.cmd have write permissions in the directory where is being run? Have you tried specifying a directory here?
    – DavidPostill
    Jan 28 '17 at 9:25










  • Later today: yes I added the path, but to no avail. Same return code. cmd.exe not executed. It ist probably staring at me, but I can't figure out what's going on :-( Does anybody?? No I haven't tried that, but I shall. The other task which is running fine doesn't specify the path either (both scripts are in the same directory). I'll report tomorrow.
    – Steinspecht
    Jan 28 '17 at 16:43


















0














I am running a daily task on Windows 10 Pro which is supposed to




  • wake the computer from hibernation

  • start cmd.exe, run a command script to copy a file to a network drive, 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 2147942401" which is hex 0x80070001.
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.



Here's an overview of the task settings (translated from German, but it should be clear):




  • General:
    execute regardless of user login; don't store password; highest privileges; configured for Windows 10


  • Actions: start program cmd.exe; arguments: /c "path-to-cmd-scriptscript.cmd >> logfile.txt"; start in: empty


  • Conditions: reactivate computer


  • Settings: allow execution if needed; if execution fails restart every 10 minutes; end task if execution longer than 3 days; force ending of active task if not stopped on request; don't start new instance



I have another task doing a backup with exactly the same setting which is running fine (wakes up, runs a script, then shuts down computer).



Any hint highly appreciated, questions welcome.










share|improve this question






















  • "start in: empty" does script.cmd have write permissions in the directory where is being run? Have you tried specifying a directory here?
    – DavidPostill
    Jan 28 '17 at 9:25










  • Later today: yes I added the path, but to no avail. Same return code. cmd.exe not executed. It ist probably staring at me, but I can't figure out what's going on :-( Does anybody?? No I haven't tried that, but I shall. The other task which is running fine doesn't specify the path either (both scripts are in the same directory). I'll report tomorrow.
    – Steinspecht
    Jan 28 '17 at 16:43
















0












0








0







I am running a daily task on Windows 10 Pro which is supposed to




  • wake the computer from hibernation

  • start cmd.exe, run a command script to copy a file to a network drive, 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 2147942401" which is hex 0x80070001.
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.



Here's an overview of the task settings (translated from German, but it should be clear):




  • General:
    execute regardless of user login; don't store password; highest privileges; configured for Windows 10


  • Actions: start program cmd.exe; arguments: /c "path-to-cmd-scriptscript.cmd >> logfile.txt"; start in: empty


  • Conditions: reactivate computer


  • Settings: allow execution if needed; if execution fails restart every 10 minutes; end task if execution longer than 3 days; force ending of active task if not stopped on request; don't start new instance



I have another task doing a backup with exactly the same setting which is running fine (wakes up, runs a script, then shuts down computer).



Any hint highly appreciated, questions welcome.










share|improve this question













I am running a daily task on Windows 10 Pro which is supposed to




  • wake the computer from hibernation

  • start cmd.exe, run a command script to copy a file to a network drive, 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 2147942401" which is hex 0x80070001.
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.



Here's an overview of the task settings (translated from German, but it should be clear):




  • General:
    execute regardless of user login; don't store password; highest privileges; configured for Windows 10


  • Actions: start program cmd.exe; arguments: /c "path-to-cmd-scriptscript.cmd >> logfile.txt"; start in: empty


  • Conditions: reactivate computer


  • Settings: allow execution if needed; if execution fails restart every 10 minutes; end task if execution longer than 3 days; force ending of active task if not stopped on request; don't start new instance



I have another task doing a backup with exactly the same setting which is running fine (wakes up, runs a script, then shuts down computer).



Any hint highly appreciated, questions welcome.







windows-10 scheduled-tasks






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 28 '17 at 9:14









Steinspecht

112




112












  • "start in: empty" does script.cmd have write permissions in the directory where is being run? Have you tried specifying a directory here?
    – DavidPostill
    Jan 28 '17 at 9:25










  • Later today: yes I added the path, but to no avail. Same return code. cmd.exe not executed. It ist probably staring at me, but I can't figure out what's going on :-( Does anybody?? No I haven't tried that, but I shall. The other task which is running fine doesn't specify the path either (both scripts are in the same directory). I'll report tomorrow.
    – Steinspecht
    Jan 28 '17 at 16:43




















  • "start in: empty" does script.cmd have write permissions in the directory where is being run? Have you tried specifying a directory here?
    – DavidPostill
    Jan 28 '17 at 9:25










  • Later today: yes I added the path, but to no avail. Same return code. cmd.exe not executed. It ist probably staring at me, but I can't figure out what's going on :-( Does anybody?? No I haven't tried that, but I shall. The other task which is running fine doesn't specify the path either (both scripts are in the same directory). I'll report tomorrow.
    – Steinspecht
    Jan 28 '17 at 16:43


















"start in: empty" does script.cmd have write permissions in the directory where is being run? Have you tried specifying a directory here?
– DavidPostill
Jan 28 '17 at 9:25




"start in: empty" does script.cmd have write permissions in the directory where is being run? Have you tried specifying a directory here?
– DavidPostill
Jan 28 '17 at 9:25












Later today: yes I added the path, but to no avail. Same return code. cmd.exe not executed. It ist probably staring at me, but I can't figure out what's going on :-( Does anybody?? No I haven't tried that, but I shall. The other task which is running fine doesn't specify the path either (both scripts are in the same directory). I'll report tomorrow.
– Steinspecht
Jan 28 '17 at 16:43






Later today: yes I added the path, but to no avail. Same return code. cmd.exe not executed. It ist probably staring at me, but I can't figure out what's going on :-( Does anybody?? No I haven't tried that, but I shall. The other task which is running fine doesn't specify the path either (both scripts are in the same directory). I'll report tomorrow.
– Steinspecht
Jan 28 '17 at 16:43












1 Answer
1






active

oldest

votes


















0














Actually, no. However, I have used the simplest task scheduler settings and now it works.



General:




  • use only when user is logged in

  • use highest privileges

  • configure for Windows 10


Action:



Program/script: C:WindowsSystem32cmd.exe

Arguments: /c <your batch file with parameters>



Conditions:




  • re-activate computer


Settings:




  • allow execution if needed

  • execute as soon as possible if start was missed

  • if task fails, restart every 5 minutes

  • terminate task if execution exceeds 3 days

  • force termination if not stopped on request

  • stop current instance if task already running


Now it's running every day at the specified time for months.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1172540%2ftask-scheduler-task-completed-successfully-with-exit-code-0x8007001%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Actually, no. However, I have used the simplest task scheduler settings and now it works.



    General:




    • use only when user is logged in

    • use highest privileges

    • configure for Windows 10


    Action:



    Program/script: C:WindowsSystem32cmd.exe

    Arguments: /c <your batch file with parameters>



    Conditions:




    • re-activate computer


    Settings:




    • allow execution if needed

    • execute as soon as possible if start was missed

    • if task fails, restart every 5 minutes

    • terminate task if execution exceeds 3 days

    • force termination if not stopped on request

    • stop current instance if task already running


    Now it's running every day at the specified time for months.






    share|improve this answer




























      0














      Actually, no. However, I have used the simplest task scheduler settings and now it works.



      General:




      • use only when user is logged in

      • use highest privileges

      • configure for Windows 10


      Action:



      Program/script: C:WindowsSystem32cmd.exe

      Arguments: /c <your batch file with parameters>



      Conditions:




      • re-activate computer


      Settings:




      • allow execution if needed

      • execute as soon as possible if start was missed

      • if task fails, restart every 5 minutes

      • terminate task if execution exceeds 3 days

      • force termination if not stopped on request

      • stop current instance if task already running


      Now it's running every day at the specified time for months.






      share|improve this answer


























        0












        0








        0






        Actually, no. However, I have used the simplest task scheduler settings and now it works.



        General:




        • use only when user is logged in

        • use highest privileges

        • configure for Windows 10


        Action:



        Program/script: C:WindowsSystem32cmd.exe

        Arguments: /c <your batch file with parameters>



        Conditions:




        • re-activate computer


        Settings:




        • allow execution if needed

        • execute as soon as possible if start was missed

        • if task fails, restart every 5 minutes

        • terminate task if execution exceeds 3 days

        • force termination if not stopped on request

        • stop current instance if task already running


        Now it's running every day at the specified time for months.






        share|improve this answer














        Actually, no. However, I have used the simplest task scheduler settings and now it works.



        General:




        • use only when user is logged in

        • use highest privileges

        • configure for Windows 10


        Action:



        Program/script: C:WindowsSystem32cmd.exe

        Arguments: /c <your batch file with parameters>



        Conditions:




        • re-activate computer


        Settings:




        • allow execution if needed

        • execute as soon as possible if start was missed

        • if task fails, restart every 5 minutes

        • terminate task if execution exceeds 3 days

        • force termination if not stopped on request

        • stop current instance if task already running


        Now it's running every day at the specified time for months.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Oct 17 '17 at 10:34









        Kamil Maciorowski

        24.5k155277




        24.5k155277










        answered Oct 17 '17 at 9:25









        Steinspecht

        112




        112






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1172540%2ftask-scheduler-task-completed-successfully-with-exit-code-0x8007001%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

            Alcedinidae

            Origin of the phrase “under your belt”?