Error Code 0x1 when Running Batch File from Task Scheduler in Windows 11

Anthony, Alexander 0 Reputation points
2023-07-19T14:20:40.4+00:00

Hi,

I'm running into an error when scheduling a batch file to run every morning at 9:00am from the task scheduler on Windows 11. The error code I'm getting is 0x1, which seems to be a privilege issue when executing the task. I've tried changing the action and currently have the batch file path in the "Program/script line" with the file folder in the "Start in (optional)" field but this still is giving me the same error code.

Does anyone know why I'm running into this error/how to fix it?

Windows for business | Windows Server | User experience | Other
Windows for business | Windows Client for IT Pros | User experience | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2023-07-21T06:39:48.0166667+00:00

    Hi @Anthony, Alexander

    The error code 0x1 you are getting when scheduling a batch file to run every morning at 9:00am from the task scheduler on Windows 11 seems to be a privilege issue when executing the task. You can try the following steps to fix it:

    1. Open the Task Scheduler and navigate to the task that is giving you the error.
    2. Right-click on the task and select "Properties".
    3. In the "General" tab, make sure that the "Run with highest privileges" checkbox is checked.
    4. In the "Actions" tab, make sure that the "Program/script" field contains the correct path to the batch file you want to run.
    5. In the "Start in (optional)" field, make sure that the folder path is correct.
    6. Click "OK" to save the changes.

    Hope the information is helpful.

    Best Regards,

    Hania Lian

    ============================================
    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

  2. Petr Svoboda 0 Reputation points
    2025-12-11T11:41:50.2733333+00:00

    Try this solution:

    Check the path and "Start in":
    
        Task Properties > Actions > Edit.
    
        Make sure the path in "Program/script" is correct and fill in the "Start in (Optional)" field with the path to the folder where the script is located.
    
    Set the highest privileges:
    
        Task Properties > General > check "Run with highest privileges".
    
    Check account permissions:
    
        Make sure that the account under which the task runs (in the General tab) has full permissions to the target files and folders.
    

    Use exit /b 0 in batch scripts:

        If the error comes directly from the script, add exit /b 0 at the end of the script to suppress the error if nothing is wrong or to allow the script to exit correctly.
    

    Summary: Error 0x1 is often about file unavailability or permissions, so checking paths and rights is key to resolving it.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.