Monday, 6 October 2025

๐Ÿงพ Steps to Schedule a Batch File in Windows Task Scheduler

Step 1: Create Your Batch File

  1. Open Notepad.

  2. Type your batch commands, for example:

    @echo off echo Running monthly maintenance... :: Add your commands here pause
  3. Save the file as monthly_task.bat (example name).
    ๐Ÿ“ Save it in a folder like: C:\Scripts\monthly_task.bat


Step 2: Open Task Scheduler

  1. Press Windows + R → type taskschd.msc → press Enter.

  2. The Task Scheduler window will open.


Step 3: Create a Basic Task

  1. Click “Create Basic Task…” on the right side.

  2. Enter a name (e.g., “Run Monthly Batch File”).

  3. Click Next.


Step 4: Set the Trigger (Schedule)

  1. Select “Monthly” → click Next.

  2. Under Months, select All months.

  3. Under Days, enter 1 (this means 1st day of each month).

  4. Set the Start time (e.g., 10:00 AM).

  5. Click Next.


Step 5: Set the Action

  1. Select “Start a program” → click Next.

  2. In the Program/script field, click Browse.

  3. Locate and select your .bat file (C:\Scripts\monthly_task.bat).

  4. Click Next.


Step 6: Finish the Setup

  1. Review the summary page.

  2. Click Finish.


Step 7: (Optional) Run as Administrator

If your batch file needs admin permissions:

  1. Right-click the created task → choose Properties.

  2. In the General tab, check “Run with highest privileges.”

  3. Click OK.


Step 8: Test the Task

  1. Right-click your task → click Run.

  2. Confirm your batch file executes properly.


Result:
Your batch file will now automatically run on the 1st of every month at the time you set.

No comments:

Post a Comment