[Python] "Run whether user is logged on or not" Scheduled python task not working as intended

Discussão em 'Python' iniciado por Stack, Fevereiro 14, 2025.

  1. Stack

    Stack Membro Participativo

    I have a scheduled task that should run a Python script daily, regardless of whether my account is logged in or not. My current configuration is:

    • General:

    Run whether user is logged on or not


    Run with highest privileges


    Configure for: Windows Server 2019
    ​
    • Triggers:

    Daily trigger at 12:00 PM
    ​
    • Actions:

    Program/script: C:/Users/my-user/My python path/python.exe


    Add arguments: C:/Users/my-user/My python.py file path/file.py
    ​

    The task runs normally when set to 'Run only when user is logged on,' but when I set it to 'Run whether user is logged on or not,' the last execution result is 0x1, and the script doesn't perform its intended actions.

    The script essentially: Moves all files from a OneDrive folder to a local folder → Reads information from all files to extract X data → Stores X data in an SQL table.

    • What have I tried?

    Using different configurations for the task in General and Actions.


    Checking my account permissions (I verified that it has 'Log on as a batch job' privileges. My account is also an Administrator)."
    ​

    Continue reading...

Compartilhe esta Página