Prev | Current Page 536 | Next

John Paul Mueller

"Administering Windows Server 2008 Server Core"

TXT) DO SchTasks /Create /S %%M /RU SYSTEM
/SC WEEKLY /D FRI /TN ???Remove Temporary Files???
/TR ???D:\MyBatch.BAT??? /ST 18:00:00
@ECHO ON
The example begins by using the Net View utility to create a list of machines. Unfortunately, the
output from this utility isn??™t very useful for a batch file, as shown in Figure 8.4. The first three lines
contain a header that you can??™t get rid of and the output ends with ???The command completed successfully.???
In addition, some machines in the list contain a comment.
Figure 8.4
Some utilities produce
helpful output,
but you can??™t use it for
a batch file.
The first FOR command gets rid of this extraneous material using three techniques. First, it relies
on the ???skip=3??? option to remove the top three lines from the file. The FOR command doesn??™t even
220 CHAPTER 8 PERFORMING TASK AUTOMATION
process these lines. At this point, the FOR command does process the three lines with machine
names. Because there??™s a space after each machine name, the result only contains the machine name
and not the comment. This is one case where the natural FOR command behavior works in your
favor. The FOR command passes the file output to an IF command.


Pages:
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548
poker online Hotel SPA Jastrzębia Góra PokerStars teksty piosenek Betsson Poker