[This is preliminary documentation and subject to change.]
The DIWbemServices.DeleteClass method deletes the specified class from the current namespace. If there is a dynamic instance provider associated with the class, the provider is unregistered, and is no longer called for that class. Any classes that derive from the deleted class are also deleted, and their associated providers are unregistered. When the class is deleted, all outstanding static instances of the specified class and its subclasses are also deleted.
If the class is provided by a dynamic class provider, the success of the deletion depends on whether class deletion is supported by that provider.
Note You cannot delete system classes.
DIWbemServices.DeleteClass(
[in] Class As String,
[in] lFlags As Long,
[in] pCtx As Object,
[out, OPTIONAL] ppCallResult As Object
) As Long
See Error Objects.
WBEM_E_ACCESS_DENIED | The current user does not have permission to delete classes. |
WBEM_E_FAILED | Unspecified error. |
WBEM_E_INVALID_CLASS | The specified class does not exist. |
WBEM_E_INVALID_OPERATION | Deletion is not supported for the specified class. It may have been a system class or a class supplied by a dynamic provider that does not support class deletion. |
WBEM_E_INVALID_PARAMETER | An invalid parameter was specified, or the namespace could not be parsed. |
WBEM_E_OUT_OF_MEMORY | There was not enough memory to complete the operation. |
WBEM_NO_ERROR | Success. |
For more information on return values see Visual Basic error handeling and return values.
Error Objects, DIWbemServices.DeleteClassAsync