Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
The Windows 2000 operating system supports virtual memory. With virtual memory, a special file on a hard disk (known as a page file or a swap file) is used to supplement the physical memory installed on a computer. When a computer begins to run low on physical memory, data can be "swapped out" to the page file. This has the following advantages:
Page files and virtual memory are extremely important to fast and effective computing. Without page files, computers would need double or triple the amount of physical memory in order to achieve the same level of performance.
System administrators need to review page file settings as part of a management routine that ensures that page files have been sized optimally and that each drive on a computer has its own page file. In addition, page file usage should be monitored on a regular basis; excessive paging often means that a computer has too little physical memory to carry out the tasks assigned to it.
WMI has several classes that can be used to help manage page files, including the Win32_PageFile class, which returns detailed information about each page file on a computer. Table 10.10 shows several of the key properties of this class.
Table 10.10 Win32_PageFile Properties
Property | Description |
---|---|
CreationDate | File creation date. |
CSName | Name of the computer system. |
Description | Description of the object. |
Drive | Drive letter (including colon) of the file. |
EightDotThreeFileName | |
FileSize | Size of the file (in bytes). |
InitialSize | Initial size of the page file, in megabytes. |
InstallDate | Date the page file was created. |
MaximumSize | Maximum size of the page file as set by the user. The operating system does not allow the page file to exceed this limit. |
Name | File name of the page file. |
Path | Path of the file. This includes leading and trailing backslashes. |
Listing 10.19 contains a script that enumerates the properties of all the page files on a computer. To carry out this task, the script must perform the following steps:
This returns a collection of all the page files on the computer.
Listing 10.19 Enumerating Page File Properties
|
|
Send us your feedback | « Previous | Next » |