Solved

Batch file: Run each 5 minutes

Posted on 2011-09-18
3
368 Views
Last Modified: 2012-05-12
I want to write a batch file to run each 5 minutes
0
Comment
Question by:egovernment
  • 2
3 Comments
 
LVL 6

Expert Comment

by:KOTiS
ID: 36556033
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
 
LVL 43

Accepted Solution

by:
Steve Knight earned 500 total points
ID: 36556074
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
 
LVL 43

Expert Comment

by:Steve Knight
ID: 36934968
Thanks.  What did you end up doing?
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now