Returns information about the initial and maximum sizes of all the page files on a computer.

JavaScript
Edit|Remove
var wbemFlagReturnImmediately = 0x10;
var wbemFlagForwardOnly = 0x20;

   var objWMIService = GetObject("winmgmts:\\\\.\\root\\CIMV2");
   var colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PageFileSetting", "WQL",
                                          wbemFlagReturnImmediately | wbemFlagForwardOnly);

   var enumItems = new Enumerator(colItems);
   for (; !enumItems.atEnd(); enumItems.moveNext()) {
      var objItem = enumItems.item();

      WScript.Echo("Caption: " + objItem.Caption);
      WScript.Echo("Description: " + objItem.Description);
      WScript.Echo("Initial Size: " + objItem.InitialSize);
      WScript.Echo("Maximum Size: " + objItem.MaximumSize);
      WScript.Echo("Name: " + objItem.Name);
      WScript.Echo("Setting ID: " + objItem.SettingID);
      WScript.Echo();
   }