Menu
Home
Products
  WmiSet Components
    Release History
    TWmiQuery
    TWmiProcessControl
    TWmiOs
    TWmiRegistry
    TWmiConnection
    TWmiStorageInfo
    TWmiSystemEvents
    TWmiMethod
    TWmiPerformanceMonitor
  NTSet components
  "How to" zone
  Shareware
  Full version
  Archive
  NTSet
  WmiSet
Contact us
Advanced search
Site map

Quick search

Advanced search

New version notify
e-mail address: Subscribe Unsubscribe
Privacy statement
TWmiDiskQuotaControl component
TWmiDiskQuotaControl is a part of WmiSet Component Collection for Delphi, C++Builder. It controls how much space the user can occupy on a disk with NTFS file system. The VCL component uses the features implemented in Windows XP or higher operating systems. It will not work on Windows 2000 or older OSes.

The component works at the two levels:
  • It can changes settings for a logical drive. This will affect all the users who accesses the drive. Use QuotaSettings property to change default disk usage limit, default warning limit, as well as actions taken when the user reaches/exceeds the limit.
  • It can customize the quotas of individual users to have different values than default settings for a logical drive.
Code example.
This code assumes that TWmiDiskQuotaControl component was dropped on the form at design time. The code enforces disk quotas on drive C: and sets the default disk quota to 500 Mb.
procedure TForm1.ProcessQuotas;
var
  i: integer;
begin
  with WmiDiskQuotaControl1 do
  begin
    for i := 0 to QuotaSettings.Count - 1 do
    begin
      if Pos('C:', QuotaSettings[i].VolumePath) <> 0 then
      begin
        QuotaSettings[i].State := QUOTAS_ENFORCE;
        QuotaSettings[i].DefaultLimit := '500000000';
        Break;
      end;
    end;
  end;
end;
              
Demo program.
This demo program is written using TWmiDiskQuotaControl component. It implements disk quota manager that is capable of managing disk quotas on the network computers. This demo requires Windows XP, or Server 2003 or higher operating system. Download WmiSet to see the source code of the demo application. You may also download executable here.