Dmitry Dyachkov
Dmitry Dyachkov

Reputation: 1785

Scheduler task indefinite time duration on Windows Server 2003/2008

Schtasks /create /s $server /ru $user /rp $password /tn $taskName /sc MINUTE /mo $intervalMin /tr $cmd

This command creates a task in scheduler to be executed each minute.

How to resolve this weird behaviour?

Upvotes: 2

Views: 3336

Answers (1)

Dmitry Dyachkov
Dmitry Dyachkov

Reputation: 1785

The solution is to create the task this way:

schtasks /create /s $server /sd $startdate /st $starttime /ru $user /rp $password /tn $taskName /sc daily /mo $scheduleDays /tr $cmd /RI $intervalMin /DU $duration

Create daily task, set /RI = 1 (minute) and /DU = "24:00" /mo = 1(day)

The task will be executed forever each minute on Server 2003‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎ ‎‎‎‎‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎

Upvotes: 3

Related Questions