Windowsでcronのように定期的に実行する「タスク」を登録する

「タスク」の機能をCUIから利用する方法

現在登録されているタスクを表示

schtasks

タスクを登録

schtasks /Create /tn "タスク名" /tr "実行するプログラム(パラメタも)" /sc 実行する間隔 ...

例)rubyw で biff.rb を10分間隔で実行するタスク

schtasks /Create /tn "biff" /tr "c:\Program Files\ruby-1.8\bin\rubyw.exe d:\myproject\lang\ruby\biff\biff.rb" /sc minute /mo 10

タスクを今すぐ実行

schtasks /Run /tn "タスク名"

例)rubyw で biff.rb を10分間隔で実行するタスク

schtasks /Create /tn "biff" /tr "c:\Program Files\ruby-1.8\bin\rubyw.exe d:\myproject\lang\ruby\biff\biff.rb" /sc minute /mo 10

使い方(ヘルプ)を表示

schtasks /?
schtasks /Create /?
schtasks /Run /?