Menu
Home
Products
  WmiSet Components
    Release History
    TWmiQuery
    TWmiProcessControl
    TWmiOs
    TWmiRegistry
    TWmiConnection
    TWmiStorageInfo
    TWmiDiskQuotaControl
    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
TWmiDiskKeeper component
TWmiDiskKeeper is a part of WmiSet Component Collection for Delphi, C++Builder. It helps maintaining disk volumes on a local or remote computer. The component requires Windows Server 2003, Windows Vista, or newer operating system. The component has the following capabilities:
  • List disk volumes on the destination computer.
  • Analyzes the state of the disk volume and produces detailed statistics.
  • Defragments the volumes
  • Checks volumes for errors, or schedules the check for the next reboot
  • Adds and deletes the mount points. This allows to mount new volumes into the directories of the existing volumes, similar to how Unix operates
Code Example: Defragmenting the volume
This is a Delphi console application that shows the example how to use TWmiDiskKeeper to defragment the volume.
procedure DefragmentDisk();
var
  vDiskKeeper: TWmiDiskKeeper;
  vVolume: TWmiVolume;
begin
  vDiskKeeper := TWmiDiskKeeper.Create(nil);
  try
    vDiskKeeper.Active := true;
    vVolume := vDiskKeeper.FindVolumeByName('C:');
    writeln('Deframenting volume C: ...');
    vVolume.RunDefragment(true);
    writeln('Drive C: sucessfully defragmented');
  finally
    vDiskKeeper.Free;
  end;
end;
              
GUI example.
WmiSet component collection comes with a demo project that shows how to use TWmiDiskKeeper component in a GUI application. Look in the examples\DiskKeeper directory. Click on the image do download the demo application that can analyze and defragment volumes.