how to schedule a task for every 5 minutes in windows command prompt?

Yosuva A picture Yosuva A · Mar 4, 2015 · Viewed 27.3k times · Source

I'm currently scheduling .bat files using Windows Task Scheduler. However, I want to do this using the Command Prompt's schtasks command. My batch file should run every five minutes and repeat its task every day.

Answer

Cristian Marian picture Cristian Marian · Mar 4, 2015

I don't have much experience with .bat file (and maybe what I am about to write is nonsence), but I was wondering if a GOTO and a delay can resolve your problem.

:label
<do stuff>
SLEEP 300
GOTO label

LE: Ok, I found something that might help you:

schtasks /create /sc minute /mo 5 /tn "TaskName" /tr \\scripts\whatever.bat

This line should do the trick. For more information you can visit https://technet.microsoft.com/en-us/library/cc772785(v=ws.10).aspx