๐งพ Steps to Schedule a Batch File in Windows Task Scheduler
Step 1: Create Your Batch File
-
Open Notepad.
-
Type your batch commands, for example:
-
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
-
Press Windows + R → type
taskschd.msc
→ press Enter. -
The Task Scheduler window will open.
Step 3: Create a Basic Task
-
Click “Create Basic Task…” on the right side.
-
Enter a name (e.g., “Run Monthly Batch File”).
-
Click Next.
Step 4: Set the Trigger (Schedule)
-
Select “Monthly” → click Next.
-
Under Months, select All months.
-
Under Days, enter 1 (this means 1st day of each month).
-
Set the Start time (e.g., 10:00 AM).
-
Click Next.
Step 5: Set the Action
-
Select “Start a program” → click Next.
-
In the Program/script field, click Browse.
-
Locate and select your
.bat
file (C:\Scripts\monthly_task.bat
). -
Click Next.
Step 6: Finish the Setup
-
Review the summary page.
-
Click Finish.
Step 7: (Optional) Run as Administrator
If your batch file needs admin permissions:
-
Right-click the created task → choose Properties.
-
In the General tab, check “Run with highest privileges.”
-
Click OK.
Step 8: Test the Task
-
Right-click your task → click Run.
-
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