Windows 10 Home, scheduled task

Marius - Roma 331 Reputation points
2021-04-04T09:04:39.683+00:00

I have 2 PCs, one Windows 10 Pro and one Windows 10 Home.
I created a PowerShell script to check the battery status and the network connection and I want to execute it every 5 minutes on each PC.
On the Windows 10 Pro PC I can create a scheduled task and it works fine.
On the Windows 10 Home PC I create the same scheduled task but each time it runs I get return code 2147942401.
After investigating the problem it looks that the user used to run the scheduled task is missing the right to logon as a batch job.
Is there any other explaination of the problem?
Unfortunately, Windows 10 Home does not include secpol.msc neither gpedit.msc.
How can I make my script run as a scheduled task on Windows 10 Home?
Regards
marius

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,597 questions
0 comments No comments
{count} votes

Accepted answer
  1. Carl Fan 6,836 Reputation points
    2021-04-05T07:04:17.523+00:00

    Hi,
    According to the error code, In order to fill this you should open your schedule task and then right-click to open properties window. Navigate to actions tab and then click edit. When you open it you’ll realize it’s not filled and you need to fill in the path to your batch file. This is related to task scheduler error code 2147942401 which is also the same as 0x80070001.
    Meanwhile, please check the steps below if it works.
    https://superuser.com/questions/1172540/task-scheduler-task-completed-successfully-with-exit-code-0x8007001?rq=1
    Hope this helps and please help to accept as Answer if the response is useful.
    Best Regards,
    Carl

    1 person found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Castorix31 81,636 Reputation points
    2021-04-04T09:33:46.833+00:00

    Have you tried with the recommendations from Windows Task Scheduler: Configure to run a PowerShell Script
    (like -ExecutionPolicy Bypass)

    1 person found this answer helpful.
    0 comments No comments

  2. Marius - Roma 331 Reputation points
    2021-04-04T16:48:48.667+00:00

    Many thanks for the answer and the usefull pointer.
    It's the way it works on my Windows 10 Pro PC.
    The same settings on my Windows 10 Home PC produce return code 2147942401.
    Is there any way to avoid it?
    Regards
    marius

    0 comments No comments

  3. Marius - Roma 331 Reputation points
    2021-04-05T15:01:20.42+00:00

    Thank you for your suggestion.
    My analysis was wrong, the problem did not depend on the Windows 10 Home version but on an incorrect script path.
    After moving the script to a different path (without spaces in the folder names), the scheduled task is working properly.
    Regards
    marius

    0 comments No comments