The DefragAnalysis method generates a fragmentation analysis for a volume.
This topic uses Managed Object Format (MOF) syntax. For more information about using this method, see
Calling a Method.
Syntax
uint32 DefragAnalysis(
[out] boolean DefragRecommended,
[out] object DefragAnalysis
);
Parameters
- DefragRecommended [out]
-
If true, defragmentation of the volume is recommended.
On Windows Vista, this value will be true if the file fragmentation on the volume exceeds 10%. On earlier versions of Windows, this value will be true if the average of the percent file fragmentation and percent free space fragmentation of the volume exceeds 10%.
- DefragAnalysis [out]
-
Embedded instance of a Win32_DefragAnalysis containing the properties that describe the extent to which the volume is fragmented.
Return Value
Returns one of the following numeric values.
| Return code | Description |
- 0
| Success
|
- 1
| Access Denied
|
- 2
| Not Supported
|
- 3
| Volume Dirty Bit Is Set
|
- 4
| Not Enough Free Space
|
- 5
| Corrupt Master File Table Detected
|
- 6
| Call Canceled
|
- 7
| Call Cancellation Request Too Late
|
- 8
| Defrag Engine Is Already Running
|
- 9
| Unable To Connect To Defrag Engine
|
- 10
| Defrag Engine Error
|
- 11
| Unknown Error
|
Examples
For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.
For C++ code examples, see WMI C++ Application Examples.
Requirements
| Minimum supported client | None supported |
| Minimum supported server | Windows Server 2003 |
| MOF | Vds.mof |
| DLL | Vdswmi.dll |
| Namespace | \root\cimv2 |
See Also
- Win32_Volume
Send comments about this topic to Microsoft
Build date: 11/3/2009