SWbemObject.Clone_ method
The Clone_ method of the SWbemObject object returns a new object that is a clone of the current object.
For an explanation of this syntax, see Document Conventions for the Scripting API.
Syntax
objWbemObject = .Clone_( _ )
Parameters
This method has no parameters.
Return value
If successful, this method returns a new SWbemObject object.
Error codes
After completion of the Clone_ method, the Err object may contain one of the error codes in the following table.
| Error (Name/Dec/Hex) | Meaning |
|---|---|
|
Unspecified error. |
|
Nothing was specified as a parameter, and it is not acceptable in this usage. |
|
Not enough memory to clone the object. |
Remarks
Use the Clone_ method to duplicate a class definition or an instance. This is useful when you need the original copy of the object for backup purposes while you are modifying a new copy. Likewise, use this method to create many new instances from a single source instance. For example, use SWbemObject.SpawnInstance_ to create a single starting instance, and use SWbemObject.Clone_ to produce 100 copies of the instance quickly. Subsequently, you can modify the objects, giving each one specific values.
It is not possible to use this method to convert a class definition to an instance, or to convert an instance to a class definition.
Examples
For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.
Requirements
|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
|---|---|
|
Minimum supported server | Windows 2000 Server [desktop apps only] |
|
Type library |
|
|
DLL |
|
Send comments about this topic to Microsoft
Build date: 11/19/2012