exe command line.
Thereafter, you can double-click any .ps1 file to run the script.
Windows PowerShell | 571
Scripting and
Automation
Automate Scripts with the Task Scheduler
Vista??™s Task Scheduler is fairly simple, allowing you to schedule any program
or??”more importantly in the context of this chapter??”any script to run
at a specific time or regular intervals.
To open Task Scheduler, open your Start menu, type taskschd.msc /s in the
Search box, and press Enter. (Omit the /s parameter to jump to the Task
Scheduler Library instead of showing the summary page by default.) The
Task Scheduler tool in Windows Vista (Figure 9-5) is complex and somewhat
unfriendly, which is surprising since it replaces the simpler (and more
feeble) Scheduled Tasks folder in earlier versions of Windows.
What??™s nice about Task Scheduler is that it??™s actually a technology that is
somewhat well integrated into the operating system. Any application can
create a schedule for itself, and you can plainly see those that are in effect
simply by opening Task Scheduler and selecting the Task Scheduler Library
folder. For the more forgetful among us, you can use it to schedule backups
once a week, remind you to stand up and stretch once an hour, or even fire
up Media Center when your favorite TV show is about to air.
Figure 9-5. Use Task Scheduler to run programs or scripts at certain times or regular
intervals, or to change schedules other programs may have set up without your knowledge
572 | Chapter 9: Scripting and Automation
To create a new schedule, click the Create Basic Task link in the Actions
pane to your right, and then answer the questions as follows:
Create a Basic Task
Type the name of the task to appear in your task library; the description
is optional.
Pages:
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795