Enumerates the disk quota settings for each drive 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_QuotaSetting", "WQL",
                                          wbemFlagReturnImmediately | wbemFlagForwardOnly);

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

      WScript.Echo("Caption: " + objItem.Caption);
      WScript.Echo("Default Limit: " + objItem.DefaultLimit);
      WScript.Echo("Default Warning Limit: " + objItem.DefaultWarningLimit);
      WScript.Echo("Description: " + objItem.Description);
      WScript.Echo("Exceeded Notification: " + objItem.ExceededNotification);
      WScript.Echo("Setting ID: " + objItem.SettingID);
      WScript.Echo("State: " + objItem.State);
      WScript.Echo("Volume Path: " + objItem.VolumePath);
      WScript.Echo("Warning Exceeded Notification: " + objItem.WarningExceededNotification);
      WScript.Echo();
   }