Remember that the first word
of the last line of the file is ???The.??? By using the code IF %%M NEQ The, you can remove the offending
line. The final step copies only the good input to a new file named Machines.TXT by redirecting the
output of the ECHO command.
The batch file shown in Listing 8.1 requires two files. The first is a text file containing a list of file
specifications. The second is the batch file itself. The next two FOR commands copy these two files
to every machine on the network. Because the file could already exist (this could be an update), you
use the /Y command line switch with the Copy utility.
The final step creates the required scheduled task on every machine. Notice the use of the /S
command line switch to access each machine in turn. The resulting task runs every Friday at 6 P.M.
using the system account.
Providing Fault Tolerance for an After Hours Batch or Script
The Task Scheduler provides an effective way to manage jobs on your system. With the AT utility,
WMIC command, and SchTasks command at your disposal, you have considerable flexibility in
creating and managing automated jobs. Of course, creating and managing the jobs doesn??™t ensure
they??™ll run as expected.
Pages:
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549