
Windows 98 makes significant changes in the ways disk and file maintenance operations are performed in comparison to previous versions of Windows. Scheduling with Task Scheduler means you can run jobs routinely--they are never forgotten or ignored. The Maintenance Wizard helps you configure utilities to keep your computer running smoothly. Also new to Windows 98 is Windows Scripting Host, a robust mechanism that is designed to help you automate basic desktop functions.
Task Scheduler is a background application that loads each time you start Windows 98. You use Task Scheduler to schedule routine hard disk maintenance operations or to schedule any other tasks that you need to run on a recurring basis.
You can access Task Scheduler in the following ways:
During installation, Windows 98 creates three scheduled tasks for you as shown in Figure 18.1.
FIGURE 18.1 Windows 98 automatically sets up ScanDisk, Defragment, and Disk Cleanup scheduled tasks.
Before you set up your own scheduled tasks, it is important to understand the concept behind Task Scheduler. Task Scheduler can only launch program files, data files from registered application programs, or script programs. Think of Task Scheduler as an automatic way of using the Windows Run Command dialog box at a prearranged time. See Table 18.1 for a list of files types supported:
TABLE 18.1 Task Scheduler File Types
| File Type Description | General Description |
| Executable files | File extensions .COM and .EXE. Command line switches are allowed. |
| DOS batch files | File extension .BAT. |
| Windows application files | Any Windows program data file with a registered file type extension. |
| Windows Scripting Host | File extensions .JS and .VBS. |
Scheduled tasks are inserted into the Task Scheduler application where you carry out all scheduling and task modification functions. From the Task Scheduler, you will be able to:
Scheduling tasks to run on a regular basis will help improve your productivity. Think about the different routines you perform manually in Windows. Is there an icon you click regularly to generate a report? Do you open a spreadsheet the same time every day? Maybe you use a Zip disk to back up files on your hard disk every day. Here are some examples of the types of tasks that you can schedule:
NOTE: Task Scheduler is an updated version of the Microsoft Plus! System Agent. All System Agent scheduled events present on your system were automatically converted to Task Scheduler during the Windows 98 installation routine.
Using the Scheduled Task Wizard
You add all tasks and set all basic properties of a task through the Scheduled Task Wizard. The Scheduled Task Wizard uses a step-by-step approach to walk you through scheduling tasks and setting all of the run-time properties necessary for tasks to execute.
To add a new task to Task Scheduler, double-click the Task Scheduler icon in the Notification Area of the Taskbar. Click the Add Scheduled Task icon. The Scheduled Task Wizard program is launched as shown in Figure 18.2.
FIGURE 18.2 Add a scheduled task with the Scheduled Task Wizard.
Press Next to continue. The wizard presents a list of registered Windows application programs found on your PC, as shown in Figure 18.3. By default, all registered applications appear in the program selection box. Select the program you want to schedule. Click the Browse button to search your hard disk for other applications not found in the program selection box such as DOS programs or batch files.
FIGURE 18.3 Select the program you want to schedule.
Click Next. Accept the default task name or replace the name of the task with a more friendly name describing the program to be used or the task to be scheduled, if desired. Choose from the Perform this task list an interval (frequency) or event from which to trigger the execution of the task as shown in Figure 18.4.
FIGURE 18.4 Name the scheduled task and specify and an interval or event.
Depending on the interval or event you have chosen for your task, you will be presented with a different dialog box for each setting. Your available choices are shown in Table 18.2.
TABLE 18.2 Scheduled Task Intervals and Events
| Task Interval | Interval Options | Values | Start Options |
| Daily | Every day | Date | |
| Weekdays only | |||
| Number of days between runs | 1-365 | ||
| Weekly | Every number of weeks | 1-52 | |
| Days of the week | Mon.-Sun. | ||
| Monthly | Day of the month | 1-31 | |
| 1st, 2nd, 3rd, 4th, or last day | Mon.-Sun. | ||
| One Time | None | ||
| System Startup | None | ||
| Logon | None |
Choose an interval or event. Click Next. The Scheduled Task Wizard tells you that your task has been successfully scheduled, as shown in Figure 18.5.
FIGURE 18.5 The scheduled task is ready to be entered into your Windows schedule.
Enable the Open advanced properties check box if you want to further customize settings at the conclusion of the wizard. These advanced properties are optional. To view the advanced properties later, right-click on a scheduled task; then choose Properties.
Click Finish to end the Scheduled Task Wizard. Your new scheduled task now appears in the Scheduled Tasks window, as shown in Figure 18.6.
FIGURE 18.6 The Scheduled Task Wizard has added the new task to your Windows schedule.
Each task in Task Scheduler can be modified or deleted. Right-click on a task and choose Properties to modify its settings, as shown in Figure 18.7, or choose Delete to remove the task from the Scheduled Tasks window.
FIGURE 18.7 You can easily modify the settings or properties of a scheduled task.
TIP: To run a task immediately, right-click on the task and choose Run.
Task Scheduler Advanced Options
The Scheduled Task Wizard enables you to set job intervals to run as frequently as every day. As shown in Table 18.3, from Task Scheduler Advanced properties you will be able to schedule down to the minute. The Optional settings enable you to configure Task Scheduler to perform a post-task delete, run a task only when the computer is idle, or enable power-management options.
TABLE 18.3 Task Scheduler Advanced and Optional Settings
| Advanced Schedule Options | Optional Settings |
| Start and End Date | Task Completed Options |
| Repeat Task Options | Idle Time Settings |
| Stop Time | Power Management Options |
Advanced schedule properties are not set through the Scheduled Task Wizard. Right-click a scheduled task, choose Properties, and then select the Schedule tab. Click the Advanced button. Tailor the Advanced Schedule Options to meet your task's requirements, as shown in Figure 18.8.
FIGURE 18.8 Set advanced schedule options to meet your requirements.
TIP: Tasks are stored on your hard disk in the C:\Windows\Tasks folder. This is a special Windows system folder. To view the contents of this folder, use Windows Explorer or navigate to the folder from the MS-DOS command prompt. A task is assigned a .JOB file extension. To edit a task from Windows Explorer, right-click the task and then choose Properties.
From the Advanced Properties tab, you can specify the following optional settings:
You can set the Scheduler to repeat a task by the minute or by the hour for any duration. Or you can repeat a task until a specified time. After the duration has been reached, you can elect to terminate the task.
Advanced options are used to set the scheduler to stop a job before a particularly resource-intensive task starts. For example, you can make sure that ScanDisk or Defragmenter stops before you start Disk Cleanup.
Click on a scheduled task's Properties Settings tab to control task completion and idle time, and to enable power management features as follows:
You will undoubtedly find ways to schedule multiple jobs to suit your needs. In that regard, Task Scheduler helps you become more efficient and more productive. However, Task Scheduler only runs programs; it does not interact with them. After Task Scheduler launches your application, its job is finished.
If, for example, your application must display a dialog box because user intervention is required (a choice or selection must be made), the program will halt. Task Scheduler is not a macro-like program designed to supply keystrokes or enter other information.
It might be possible to use a third-party batch or macro language program to create the needed steps to activate a program, then step through the required commands. This macro or batch program could then be entered as a scheduled task.
NOTE: An application waiting for a response will sit indefinitely unless you set the scheduler option to terminate the job after a specified period of time.
Think of the Maintenance Wizard as an office manager. Someone who must schedule and coordinate clerks to organize the files, make sure the custodial service empties the trash, and periodically send someone to inspect the building foundation for any sign of weaknesses. The Maintenance Wizard consists of three components, as shown in Table 18.4.
TABLE 18.4 Maintenance Wizard Utilities Programs
| Name | Description |
| Disk Defragmenter | Logically organizes files and folders on your hard disk for faster access |
| ScanDisk | Checks your hard disk for file system problems |
| Disk Cleanup | Deletes unnecessary files on your hard disk |
These maintenance utilities have already been set up in your Scheduler Tasks folder as a part of the Windows 98 installation routine. You can however start the Maintenance Wizard at any time to collectively run the maintenance programs or to modify program settings. To start the Maintenance Wizard, use either of the two following methods:
FIGURE 18.9 Perform maintenance now or change settings/schedule.
TIP: You can edit each Maintenance task manually from the Task Scheduler folder.
You are presented with two options--either perform maintenance now or change your settings or schedule. To tune your system now, enable the Perform Maintenance Now radio button; then click OK. To customize how the Maintenance Wizard functions or to change settings and schedules, enable the Change My Maintenance Settings or Schedule radio button and then click OK.
The most complete way to schedule maintenance is to select the Custom option. If you choose this route, you will be required to make a number of choices about the way your computer will be optimized. The choices available to you are:
Now that the jobs are scheduled on a regular basis, a certain amount of planning might be necessary. Depending on the size and number of hard disks and the other jobs you have running, if you were to run a thorough ScanDisk every night, you should probably make sure that it isn't going to conflict with other tasks. You also wouldn't want it to interrupt you when you are working on your computer.
Any solid disk management program for your computer should include backing up files regularly, running ScanDisk to check the integrity of your disk(s), and using Defrag to keep the files on disk in order. The key is running these on a regular basis. Chances are, on most computers without scheduling, these tasks do not get done as regularly as they should. It is also a part of good disk management to make sure you delete temporary files and any leftover files from setup applications. With the exception of a backup, the Maintenance Wizard schedules all of these system activities as regularly as you need.
Disk Cleanup is new utility used to remove several different types of unnecessary files on your hard disk, as shown in Table 18.5. In prior versions of Windows these files had to be removed manually to conserve disk space. To start Disk Cleanup click the Start button; then choose Programs, Accessories, System Tools, Disk Cleanup.
TABLE 18.5 Disk Cleanup Can Delete Many Unnecessary Files
| File Type | Description |
| Temporary Internet Files | Web browser cache files |
| Download Program Files | Web page temporary ActiveX controls and Java applets |
| Recycle Bin | Recycle Bin contents |
| Temporary Files | Temporary program and other installation-related files |
Choose a hard disk from the selection list. Click OK. After Disk Cleanup has searched all of your folders, it calculates the amount of space you can save, as shown in Figure 18.10.
FIGURE 18.10 Disk Cleanup is ready to remove unnecessary files.
To use the default Disk Cleanup settings to remove the unnecessary file types listed in the Files to Delete text box, click OK. To potentially free additional disk space, click the More Options tab. Make your selections to remove optional Windows components or to uninstall programs that are no longer needed. Click the Settings tab to control when Disk Cleanup will run based upon detected low disk space.
Disk Defragmenter improves file access times by storing files in contiguous sectors. An enhancement to Windows 98 is its ability track program and file usage to speed program execution based upon the user's activities. To launch Disk Defragmenter, click the Start Button, then choose Programs, Accessories, System Tools, Disk Defragmenter. The Disk Defragmenter program starts, as shown in Figure 18.11.
To begin hard disk defragmentation with the default program settings, click the OK button. To select miscellaneous file arrangement and error checking options, click the Settings button. It is usually not necessary to change these default settings. Depending upon the size of your hard disk(s), the defragmentation process may take a considerable amount of time. It is best to schedule defragmentation when you plan to be away from your computer.
FIGURE 18.11 Run Disk Defrag-menter regularly to keep your hard disk in top-notch shape.
NOTE: Disk Defragmenter and ScanDisk, discussed in the next section, do not run well as background tasks. Any disk activity will interfere with the execution of these programs. Schedule these tasks for times when your computer is idle.
ScanDisk checks the integrity of your hard disk and can make an attempt to repair it if logical errors are found. ScanDisk can perform two types of integrity checks:
ScanDisk checks for file system problems as follows:
To launch ScanDisk, click the Start button, then choose Programs, Accessories, System Tools, ScanDisk. The ScanDisk program starts, as shown in Figure 18.12.
FIGURE 18.12 ScanDisk checks your hard disk for logical errors.
To begin a hard disk scan, select the type of test to be performed, Standard or Thorough. If you select the Thorough test, you might optionally set Surface Scan Options criteria by clicking the Options button. The Automatically fix errors check box is enabled by default. If you want to be prompted by ScanDisk prior to an error repair attempt, disable this setting.
When you are ready to begin the ScanDisk operation, click Start. Depending on the size of your hard disk(s), the test may take a considerable amount of time. It is best to schedule ScanDisk when you plan to be away from your computer.
Of all the new system utilities in Windows 98, the one that you should probably hope to run the least is the FAT32 Conversion Wizard. If you were previously running Windows 95 4.00.950 B, also known as Win95 SR2, you might have already addressed issues of software and hardware compatibility with the FAT32 system, if not, this section covers some cautionary guidelines of converting to FAT32 and a run-through of the FAT32 Wizard.
NOTE: To verify which file system is installed on your computer, open My Computer, right-click on your hard drive, then select Properties. The hard drive properties dialog box will display a File system field indicating either FAT16 or FAT32.
Although FAT32 is a more efficient, higher performance file system than its predecessor, FAT16, you might encounter some compatibility problems with legacy programs. Other compatibility issues include:
FAT32, on the other hand, is superior to FAT16 in the following areas:
To start the FAT32 Converter click Start, Programs, Accessories, System Tools, FAT32 Converter. The Drive Converter (FAT32) Wizard starts, as shown in Figure 18.13.
FIGURE 18.13 Convert your FAT16 file system to FAT32 for more efficient hard disk operation.
Select the hard disk you want to convert from the drive listing in the Drive text box. You might be prompted to remove anti-virus programs. You will also be warned that any other versions of Windows will not recognize FAT32.
The FAT32 converter checks to see if there are programs on the drive that will not work with Windows 98. In the event that there are not, you can elect to run a backup with MS Backup. The Wizard will resume when it is complete.
The last step of the Wizard informs you that it needs to start in MS-DOS mode to continue. The system restarts and the conversion begins. Conversion time varies by computer--the speed of your CPU, size of your hard disk, and number of files and folders can be factors.
After the conversion is complete, Windows 98 restarts again and the Wizard resumes to execute Disk Defragmenter. You are then notified that the conversion process completed successfully.
By formal definition, Windows Scripting Host (WSH) is a language- independent scripting host for Microsoft 32-bit Windows platforms. As it relates to Windows 98, this means that scripts that heretofore could be run only by being embedded into HTML (Web) pages can now run directly within the Windows 98 operating system.
This section is not intended to be a full and complete exploration of Windows Scripting Host. In fact, the topic could easily cover several long chapters, or even a whole book. This section is intended only to introduce you to the Windows Scripting Host concept from an overview perspective.
Though you might have noticed that Windows Scripting Host is classified by Windows 98 Setup as being an "Accessory," nothing could be further from the truth. When you think of Windows Accessories, programs such as Notepad or WordPad may come to mind. To launch an accessory program such as Notepad, you would click the Start button, choose Accessories, then Notepad. But Windows Scripting Host is not a program in same sense as Notepad is a program. You do not launch Windows Scripting Host to be greeted by a main program window. Windows Scripting Host is more like an environment supplied by Windows 98 in which scripts can run.
If you have ever designed a Web page that included a script, you might be somewhat familiar with scripting programs. Your script was designed to be a part of a Web page. The Web browser would interpret and execute the script code in the context of displaying the Web page for you. Without a browser the script was useless. Windows 98 changes this principle. Scripts no longer need to be embedded in Web pages and only acted upon by a browser. Scripts may be run from the Windows 98 Desktop or from a command line.
NOTE: Windows 98 ships with 11 sample scripts. During installation these scripts are installed in the C:\Windows\Samples\Wsh folder.
There are two executables files that are used in conjunction with Windows Scripting Host:
The benefit of Windows Scripting Host over MS-DOS batch files is simple; a scripting language is far superior because it uses more advanced structured programming constructs, such as if-then-else and for-next-loop processing techniques. This greatly enhances a programmer's ability to work inside of a script. But scripting languages are not just for programmers; most users should adapt easily to the syntax.
Additionally, the scripting language can manipulate all registered applications. This creates possibilities for many different interactions with an application.
Windows Scripting Host (WSH) executes scripts written in either the JavaScript, Jscript, or VBScript languages. Microsoft calls Windows Scripting Host a "universal" hosting engine because it has the capability to automatically recognize the type of script and process it properly.
In that regard, Windows Scripting Host is simply a mechanism for passing the contents of a script file to the registered processing engine. Windows Scripting Host determines which engine to pass the text to based on the extension of the file.
Scripts can be run from the desktop by clicking on a script file and can be viewed or edited with a text editor such as Notepad or WordPad.
Open the sample script folder that is located at C:\Windows\Samples\Wsh, as shown in Figure 18.14.
FIGURE 18.14 Windows 98 ships with 11 sample scripts.
Right-click on the script sample named SHORTCUT.VBS. Choose Edit to view the script. Notepad opens to preview for script for you. Even if you are not an accomplished script programmer, just take a few moments to look at the script. Close Notepad to return to the sample script folder.
SHORTCUT.VBS is a very simple example script designed to create a desktop shortcut to Notepad on your Windows desktop. To see how you interact with a script, click SHORTCUT.VBS. Click OK to create the shortcut on your desktop. Click OK again to exit the script. Notice that a new shortcut to Notepad now appears on your desktop.
Assume for the moment that you are in charge of software deployment within a department at your office. Some of your users need an industrial-strength word processing application such as Microsoft Word 97, and others who only occasionally type two-line memorandums need a simpler word processor such as WordPad.
Rather than teaching your users how to locate word processor executable files in order to create shortcuts to their desktops, deploy a folder to each desktop that contains two script icons. The user chooses the word processor of his choice with one click of the mouse.
To make the process even easier, use the sample SHORTCUT.VBS as a template. SHORTCUT.VBS is based on creating a Notepad shortcut. Edit the script to use WordPad instead. Create another script based on Word 97. Copy both of these new scripts to a new desktop folder named Choose Your Preferred Word Processing Program.
Creating a desktop shortcut is just one very simple example of how a script can be employed. Because JavaScript, JScript, and VBScript are very powerful scripting languages, your scripting possibilities are endless.
© Copyright, Macmillan Computer Publishing. All rights reserved.