Windows - Auto Services
(AKA: DOS Scheduler / Automatic Tasks / Scheduled Task)
Running a program at Startup or Shutdown
- OS: Windows 2000 Professional, XP
- Start, Run, gpedit.msc
- Group Policy
- Local Computer policy
- Windows Settings
- Scripts (Startup/Shutdown)
- Startup
Running a program at a certain time
Warning: Do not assume a Drive or Directory in
your batch files!
- DOS Scheduler (WARNING: Tied to the system account)
- DOS Command: at - The AT command schedules commands and programs to run on a computer at
a specified time and date. The Schedule service must be running to use
the AT command.
- help AT - will give you help on the command.
- AT - will list the schedule of programs.
- Examples:
- at 13:30 /every:M e:\temp\testbatch.bat
(Note: Runs a batch file very Monday at 1:30pm.)
- at 13:30 /every:1 e:\temp\testbatch.bat
(Note: Runs a batch file very 1st day of the month at 1:30pm.)
- at 1 /delete
(Note: deletes the scheduled task with id = 1.
- at /delete
(Note: deletes all scheduled tasks.)
- Notes:
- Days: M,T,W,Th,F,S,Su (You can use: M,W,F etc...)
- GUI Scheduler (WARNING: tied to a user account)
- Drive Mappings - the drive mappings for that user are not known by
the task scheduler. You must include the command "net use <drive
map letter>: \\<computer>\<share
drive leter>"
- OS: Win 2000
- Start/Settings/Control Panel/Scheduled Tasks
- OS: XP
- Start/Control Panel/Scheduled Tasks, then click "Add Scheduled
Task", the click "Browse" etc...
- Your GUI options tied to a user account/password are:
- Schedule Task Options:
- Daily
- Start Time
- Schedule Task Daily every x days.
- Advanced options (see below)
- Weekly
- Start Time
- Schedule Task Weekly every x weeks.
- You can choose the days of the week.
- Advanced options (see below)
- Monthly
- Day of the Month or the (first, last, 2nd, 3rd, 4th) (Mon,Tu,W,Th,Fr,Sa,Su)
of the month.
- You can select the months (Jan - Dec)
- Advanced options (see below)
- One time only
- Start date/time
- Advanced options (see below)
- When my computer starts
- No other options available.
- When I log on
- No other options available.
- When idle
- Option is for how many minutes.
- Advanced Options:
Repeat task ever x minutes/hours
Until: Time or a Duration in hours & Minutes.
Check box for: If the task is still running, stop it at this
time.
- The GUI has a Setting & Security tab also!
- Manually running the Scheduled job.
- Sign in as the user.
- Start, Control Panel, Schedule Tasks, then right-click on
the task, Run.
- Note: Make sure you test your task from here.
- Notes:
- Scheduled Tasks - to have a task run every hour on the hour all
the time even after a reboot. (I'm testing this!
You need to test!!!). I'm not
sure how a reboot will affect this!
- Schedule Tab
- Schedule Task: Daily
- Start Time: <a time in the future>
- Every 1 days
- Advanced Option
- Start Date: <a date in the future>
- End Date: <Dec 31, 2099> (a date way in the
future) - no date may work - you'll need to test.
- Repeat Task - checked.
- Every 1 hour
- Until Duration: 24 hours, 0 min
- Un-Check - If the task is still running, stop it at
this time.