Windows – Schedule Windows Task every minute

scheduled-taskwindowswindows-server-2008

I need to schedule a Windows task to run a script every minute. In most cases, the script doesn't need to execute anything and exists immediately. When the script needs to execute something, I want it to start the job as quick as possible, thus the one minute interval.

Now, the UI of the Windows Scheduler has become quite confusing in recent years, so I'm not sure what's the best way to run a task every minute (or 5 minutes ..) on Windows 2008 R2.

Is this the best way to schedule a task under Windows every minute? Is it reliable? Does it start directly after a machine is rebooted, or is it only started again at 12pm? Please note that I cannot use/write a custom service application for this, as I need it to be very portable.

Best Answer

Yes, this service will run after reboot, you can verify it in the Task Scheduler service transaction log:

    Systemroot\SchedLgU.txt
   
    (where Systemroot is your windows installation folder)

If it's not working correctly (under XP, unsure about 2008 equivalent):

    
    Control Panel -> Administrative Tools -> Services -> Task Scheduler 

    Set to auto. 

2008 Documentation here, XP Documentation here

The task's schedule commences at the specified time, after that it executes based on the repetition parameters. The start time can be considered as "task installation" time, it is not part of the repetition parameters (except as a timer offset). Hope that makes sense!