TaskSchedulerInstructions

5

Click here to load reader

Transcript of TaskSchedulerInstructions

Page 1: TaskSchedulerInstructions

Ever had task that need to be done on a routine basis? Windows Task Scheduler can help you. Scheduling routine task

can be a more efficient solution to common task. You don’t have to remember to do them at a certain time or day,

concentrate on new task, and probably one of my most loved aspect is I remove the dependency on me, allowing me the

freedom to take time off without the worry of the task getting completed. While this is a great tool, please remember

anything unexpected can happen and cause failures and occasionally monitoring is needed. Please also, remember that

the task use the PC resources and is dependent on allocated memory at the runtime moment as well as the computer

being turned on and perhaps logged in to a network, depending on task configurations. The Task Scheduler does have a

History tab for just this purpose. Task Scheduler is an application that comes as part of the Windows Operating System.

From my experience, it is pre-installed on all windows PCs. The example below is specific to a task I am responsible for

but I do encourage everyone to explore the tool. Use your curiosity and creativity to discover the power and benefits of

the tool. Try looking at some of the existing task for examples.

To get started with Task Scheduler, launch it from windows. Below is the menu item from windows 7. If you don’t see

it, don’t panic. It’s there. Type in the name in the search bar

Search for

task

Page 2: TaskSchedulerInstructions

It is not necessary to create a new folder, I do recommend it to better organize your task from other applications (in the

default folder) that use this also. To create a new folder, click Action then New Folder. Then type in the name of the

folder.

Highlight the newly created folder in the left pane. In the far right pane, click Create Task. Next, in the task window that

pops up, type in the name you want to call the task in the General tab. Now you must configure the task. Some of the

information is a default but you can change this if needed.

Page 3: TaskSchedulerInstructions

Next, on the Triggers tab is where the schedule take place, click New. I’m not sure why the tab was named Triggers

instead of a more intuitive name like Schedule, but Triggers is also appropriate because you set when the task is

triggered. Just remember that this tab can have multiple triggers that specify when the task is to begin. This particular

task is Weekly which allows me to choose specific days such as Tuesday thru Saturday and not run on Sunday and

Monday and 7:00AM.

I don’t get to work until 7:30AM so I leave my PC on and since this task is dependent on network connectivity, I stay

logged in but leave it locked.

If I wanted this to run at 1:00AM on Sunday, then I could create another trigger with this configuration. Keep in mind

you can Enable (if checked) or Disable (if not checked)

Page 4: TaskSchedulerInstructions

Next, and frequently the last step because the defaults on the remaining tabs are sufficient for me. But I do encourage

everyone to take a peek and see if you see one that could be used for your specific task. The Action tab which specifies

the task to run. You can choose a few different options and add multiple actions for a task. Most commonly I use the

Start a program action. For the Program/script, I use a DOS batch file executable however, most executable files can be

used.

The reason I use DOS batch file executables is that my applications that I schedule have a DOS command line version of

the app and is setup to take command line arguments that do not require my intervention allowing me to run the app

when I’m not in the office at 1:00AM (I do like my sleep). Another advantage to DOS apps is that they typically startup

faster and do not need as much PC resources as windows GUI’s. Below is a DOS batch file executable that I use to run a

SSIS package for this task.

export_Statutory_Claims_GW.bat (name, always .bat extension)

"C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\dtexec.exe" /FILE "\\Wd-4qbwxv1\ssis\CLUE

REPORT\export_Statutory_Claims_GW.dtsx" /CHECKPOINTING OFF /REPORTING EWCDI /LOGGER "{0A039101-ACC1-

4E06-943F-279948323883}";"adhoc_Template.log Prod"

- Yellow highlight is the DOS executable batch file

- Green highlight are the command line arguments

Page 5: TaskSchedulerInstructions

I like to share a little more information. Clicking to highlight the folder with your task will allow you to see certain

information about all your tasks. The Status column in the top center pane will show Disabled if you have disabled the

job and to enable it click the green Enable text in the bottom right pane. The Status will change to Ready and the green

Enable text will change to Run and Disable will be displayed as an option. The Triggers column will display the schedule.

The task History tab will show the highlighted task history details and can come in handy for troubleshooting and

monitoring the task. I also want to point out the Properties text button in the bottom right pane. This is used to edit the

properties of a task. It took me a while to realize its purpose. I think it should have been labeled Properties/Edit for

people like me who know what edit means.

Your Folder

containing your

task