Lists the properties of all the disk partitions 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_DiskPartition", "WQL",
                                          wbemFlagReturnImmediately | wbemFlagForwardOnly);

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

      WScript.Echo("Access: " + objItem.Access);
      WScript.Echo("Availability: " + objItem.Availability);
      WScript.Echo("Block Size: " + objItem.BlockSize);
      WScript.Echo("Bootable: " + objItem.Bootable);
      WScript.Echo("Boot Partition: " + objItem.BootPartition);
      WScript.Echo("Caption: " + objItem.Caption);
      WScript.Echo("Config Manager Error Code: " + objItem.ConfigManagerErrorCode);
      WScript.Echo("Config Manager User Config: " + objItem.ConfigManagerUserConfig);
      WScript.Echo("Creation Class Name: " + objItem.CreationClassName);
      WScript.Echo("Description: " + objItem.Description);
      WScript.Echo("Device ID: " + objItem.DeviceID);
      WScript.Echo("Disk Index: " + objItem.DiskIndex);
      WScript.Echo("Error Cleared: " + objItem.ErrorCleared);
      WScript.Echo("Error Description: " + objItem.ErrorDescription);
      WScript.Echo("Error Methodology: " + objItem.ErrorMethodology);
      WScript.Echo("Hidden Sectors: " + objItem.HiddenSectors);
      WScript.Echo("Index: " + objItem.Index);
      WScript.Echo("Install Date: " + objItem.InstallDate);
      WScript.Echo("Last Error Code: " + objItem.LastErrorCode);
      WScript.Echo("Name: " + objItem.Name);
      WScript.Echo("Number Of Blocks: " + objItem.NumberOfBlocks);
      WScript.Echo("PNP Device ID: " + objItem.PNPDeviceID);
      try { WScript.Echo("Power Management Capabilities: " + (objItem.PowerManagementCapabilities.toArray()).join(",")); }
         catch(e) { WScript.Echo("Power Management Capabilities: null"); }
      WScript.Echo("Power Management Supported: " + objItem.PowerManagementSupported);
      WScript.Echo("Primary Partition: " + objItem.PrimaryPartition);
      WScript.Echo("Purpose: " + objItem.Purpose);
      WScript.Echo("Rewrite Partition: " + objItem.RewritePartition);
      WScript.Echo("Size: " + objItem.Size);
      WScript.Echo("Starting Offset: " + objItem.StartingOffset);
      WScript.Echo("Status: " + objItem.Status);
      WScript.Echo("Status Info: " + objItem.StatusInfo);
      WScript.Echo("System Creation Class Name: " + objItem.SystemCreationClassName);
      WScript.Echo("System Name: " + objItem.SystemName);
      WScript.Echo("Type: " + objItem.Type);
      WScript.Echo();
   }