Setting Up a Scheduled Task in Windows to Post a URL Every 5 Minutes

This guide provides step-by-step instructions for configuring a scheduled task in Windows. This task will perform an operation similar to a Linux cron job, specifically to post a URL every 5 minutes using the curl command. This process is intended for users who wish to automate tasks without the need for a Linux machine, using Windows Task Scheduler and curl.
 
Prerequisites

 

Step 1: Open Task Scheduler

  1. Press the Windows key, type “Task Scheduler,” and press Enter.
  2. In the Task Scheduler, select “Create Basic Task…” from the right-hand side panel.

 

Step 2: Create a Basic Task

  1. In the “Create Basic Task Wizard,” enter a name for your task, e.g., “Post URL Every 5 Minutes,” and provide an optional description. Click “Next.
  2. Choose “Daily” as the trigger and click “Next.”
  3. Set the start date and time for your task. Since the task will run every 5 minutes, the specific time of day to start is less critical. Click “Next.”
  4. On the “Daily” screen, ignore the “Recur every” option since we will configure the 5-minute interval later. Click “Next.”
  5. Select “Start a program” and click “Next.”
  6. In the “Program/script” field, input the path to your curl executable. If you’re unsure, you can enter curl if it’s added to your system’s PATH variable. In the “Add arguments (optional)” field, enter your curl command without “curl” at the beginning, like so: -X POST “https://www.zohoapis.com/crm/v2/functions/…” >/dev/null 2>&1. Replace the URL with your target URL. Click “Next.”
  7. Review your settings and click “Finish.”

 

Step 3: Modify the Task to Run Every 5 Minutes

  1. In Task Scheduler, find your task in the Library. Right-click on it and select “Properties.”
  2. Go to the “Triggers” tab and edit the daily trigger.
  3. Change the “Advanced settings” to “Repeat task every:” 5 minutes, for a duration of “Indefinitely.”
  4. Click “OK” to save your changes.

 

Step 4: Finalizing and Testing

• Ensure your task is enabled and check its next run time.
• You can run the task immediately by right-clicking on it and selecting “Run” to test if it posts to the URL correctly.
 
You have successfully created a scheduled task in Windows to post a URL every 5 minutes, mimicking the functionality of a Linux cron job.

Have additional questions? Search below: