Managing Software

Microsoft® Windows® 2000 Scripting Guide

The software life cycle provides an administrative framework for managing software within your organization. In the software life cycle, software is:

  • Installed

  • Maintained

  • Upgraded

  • Removed

WMI scripts can be used to install, upgrade, or remove software. Although the Software Installation and Maintenance component of Group Policy remains the preferred method for carrying out these activities, there are occasions when a scripted deployment offers advantages over Group Policy. For example, software deployment changes made by using Software Installation and Maintenance take effect only when a computer is restarted or when a user logs on, not as part of the regular Group Policy refresh. This is done to prevent loss of data; for example, any number of problems could arise if a user were in the middle of editing a document with Microsoft Word at the very moment that a new Group Policy object began to remove Word from the computer.


  • A WMI script can also attempt to remove an application while that application is currently in use, which can lead to similar problems. Because of this, you might want to use the Win32_Process class to determine which applications are running before you install, upgrade, or remove software using WMI. For more information about the Win32_Process class, see "Processes" in this book.

A computer that is never restarted will never have this new Group Policy applied, and the software will never be installed, upgraded, or removed. WMI, by contrast, allows you to install, upgrade, or remove software without requiring a computer to be restarted or requiring a user to log off and then log back on.

WMI scripts can also carry out tasks such as taking inventory of all the software installed on a computer. Because Software Installation and Maintenance is not designed to perform tasks such as these, administrators have had to purchase and use third-party software to do such things as software inventory.

In addition, WMI enables you to monitor and manage the use of software in your organization, provided the software was installed by using the Windows Installer. Windows Installer, introduced in Windows 2000, represents a new and improved way to install software by using .msi files known as packages. These packages contain all the information necessary to set up an application in every conceivable situation. In addition, Windows Installer maintains a database on each computer detailing the software and software features that have been installed on that computer. WMI has the ability to access this database and report back on the software and software features present on a computer.