The Chkdsk method invokes the Chkdsk operation on the volume. The method is only applicable to volume instances that represent a physical disk on the computer. It is not applicable to mapped logical drives.
This topic uses Managed Object Format (MOF) syntax. For more information about using this method, see
Calling a Method.
Syntax
uint32 Chkdsk(
[in] boolean FixErrors = FALSE,
[in] boolean VigorousIndexCheck = TRUE,
[in] boolean SkipFolderCycle = TRUE,
[in] boolean ForceDismount = FALSE,
[in] boolean RecoverBadSectors = FALSE,
[in] boolean OkToRunAtBootUp = FALSE
);
Parameters
- FixErrors [in]
-
If true, errors found on the disk are fixed. The default is false.
- VigorousIndexCheck [in]
-
If true, a vigorous check of index entries is performed. The default is true.
- SkipFolderCycle [in]
-
If true, the folder cycle checking should be skipped. The default is true.
- ForceDismount [in]
-
If true, the volume is dismounted before checking. The default is false.
- RecoverBadSectors [in]
-
If true, the bad sectors are located and the readable information is recovered. The default is false.
- OkToRunAtBootUp [in]
-
If true, the Chkdsk operation is performed at the next boot up, in case the Chkdsk operation could not be performed because the volume was locked at the time the method was called. The default is false.
Return Value
Returns one of the following numeric values.
| Return code | Description |
- 0
| Success
|
- 1
| Success - Volume Locked and Chkdsk Scheduled on Reboot
|
- 2
| Unsupported File System
|
- 3
| Unknown File System
|
- 4
| No Media In Drive
|
- 5
| 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