Rites
Rites

Reputation: 2332

How to run a batch file over a period of time repeatedly : Scheduling a task

I've a task(.bat file) which should be performed/executed after every 15mins.

I don't know where to make its entry so that it'll be scheduled?

With this, I want to see the execution(progress) of the task running(in command prompt).

Upvotes: 0

Views: 8421

Answers (3)

Vantomex
Vantomex

Reputation: 2295

Quoted from a Microsoft Technet article, Schtasks:

; To schedule a task that runs every 20 minutes
;
; The following command schedules a security script, Sec.vbs,
; to run every 20 minutes. The ; command uses the /sc parameter
; to specify a minute schedule and the /mo parameter to specify
; an interval of 20 minutes.

; Because the command does not include a starting date or time,
; the task starts 20 minutes after the command completes, and
; runs every 20 minutes thereafter whenever the system is running.
; Notice that the security script source file is located on a
; remote computer, but that the task is scheduled and executes
; on the local computer.

schtasks /create /sc minute /mo 20 /tn "Security Script" /tr \\central\data\scripts\sec.vbs

You can find more explanations and examples in the reference mentioned above.

Upvotes: 0

ghostdog74
ghostdog74

Reputation: 342323

take a look at schtasks command to set task on the command line

C:\test>schtasks /?

Upvotes: 3

Colin Pickard
Colin Pickard

Reputation: 46643

The Task Scheduler is an easy way to do this manually.

If you need to script it, look at the at command.

Upvotes: 1

Related Questions