• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 424
  • Last Modified:

Batch file: Run each 5 minutes

I want to write a batch file to run each 5 minutes
0
egovernment
Asked:
egovernment
  • 2
1 Solution
 
KOTiSCommented:
If you are running MS-DOS under Windows the you can create a schedule to run the batch file. If your only OS is MS-DOS then there are some resident programs. What is your OS?
0
 
Steve KnightIT ConsultancyCommented:
Yes you can either schedule it using task scheduler like has been said, or you can run one batch that pauses for 5 minutes (ish), either using a third party util, or a "PING" command, e.g.:

@echo off
:loop
echo Do the things you want here.  It is %time%
for /l %%a in (5,-1,1) do (
  echo Waiting for %%a for minutes....
  ping -n 61 -w 1000 127.0.0.1 >NUL 2>&1
)
echo Running again now
goto :loop
And call that "Yourbatch.cmd" or whatever.

Steve
0
 
Steve KnightIT ConsultancyCommented:
Thanks.  What did you end up doing?
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now