Windows 10

How to Run Batch File Automatically Every X Minutes

In this tutorial, we are going to see how to run batch file automatically every X minutes. The batch file contains a series of DOS (Disk Operating System) instructions. It allows triggering the execution of commands found in this file.
 

Example 1: How to Run Batch File Automatically Every X Minutes

The following example runs the batch file automatically every 10 seconds using timeout command:

@echo off

set INTERVAL=10
:loop
REM Put your batch file's code here.
timeout %INTERVAL%
goto:loop

 

 

Example 2: How to Run Batch File Automatically Every X Minutes

The following example runs the batch file automatically every 10 seconds using ping command:

@echo off

:loop

echo Wait for 5 minutes
REM Put your batch file's code here.

ping -n 5 127.0.0.1>nul
goto:loop

 

One thought on “How to Run Batch File Automatically Every X Minutes

  • Developer

    I need a window terminal command for repeating a command after every hour . Please help.
    Thanks

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *