Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
Service packs represent changes that have been made to the base operating system since the time the operating system was first released. These changes can include fixes to known problems, updates to device drivers, new tools, and enhanced functionality.
Knowing which service packs have been installed on a computer is important for several reasons. For example:
Hot fixes (code fixes released to address specific problems in the operating system) are generally tied to a service pack, meaning the service pack must be installed before the hot fix can be applied. Before you can apply hot fixes or other software updates, you might need to know whether a particular service pack has been installed on a computer.
Service packs are released on an as-needed basis and are cumulative. For example, when Service Pack 3 for a version of Windows is released, it contains all the updates that were included in Service Packs 1 and 2. Installing Service Pack 3 provides all the benefits of the new service pack as well as those of the first two service packs.
The version number of the latest service pack installed on a computer can be retrieved using the Win32_OperatingSystem class. The Win32_OperatingSystem class cannot retrieve the version number of previously installed service packs. However, because all the fixes and functionality found in previous service packs are included in the latest service pack, you will be able to determine the actual code base of the operating system. The code base consists of the operating system (for example, Windows 2000 Professional 5.0.2195) plus any service packs that have been used to upgrade that operating system.
Note
Two service pack related properties are available through the Win32_OperatingSystem class. These two properties are shown in Table 8.10.
Table 8.10 Win32_OperatingSystem Service Pack Properties
Property | Description |
---|---|
ServicePackMajorVersion | Major version of the latest service pack installed on the computer. If the latest service pack is 4 or 4a, the major version is 4. If no service pack has been installed, this value is 0. |
ServicePackMinorVersion | Minor version of the latest service pack installed on the computer. If the latest service pack is 4a, the minor version is a. If the latest service pack is 4, there is no minor version. To ensure that you identify the proper service pack, you must check both the major version and the minor version. |
Listing 8.8 contains a script that identifies the latest service pack installed on a computer. To carry out this task, the script must perform the following steps:
This query returns a collection consisting of the operating system currently in use on the computer.
Listing 8.8 Identifying the Latest Installed Service Pack
|
|
Send us your feedback | « Previous | Next » |