Platform SDK: Windows Management Instrumentation

DeleteEx Method in Class Win32_NTEventlogFile

The DeleteEx WMI class method will delete the logical file (or directory) specified in the object path. DeleteEx is an extended version of the Delete method. This topic uses Visual Basic syntax. For information on using this method with C/C++, see Calling a Method.

NTEventlogFile.Delete( _
ByRef StopFileName As String, _
StartFileName As String _
) As Integer

Parts

NTEventlogFile
Expression that resolves to an instance of Win32_NTEventlogFile.
StopFileName
[out] Name of the file/directory where the DeleteEx method failed. This parameter will be null if the method succeeds.
StartFileName
[in] Names the child file/directory to use as a starting point for DeleteEx. The StartFileName parameter is typically the StopFileName parameter specifying the file or directory at which an error occurred from the previous method call. If this parameter is NULL, the operation is performed on the file or directory specified in the ExecMethod call. This parameter is optional.

Return Values

Returns an integer value of 0 if the file was successfully deleted, and any other number to indicate an error.

Value Meaning
0 The request was successful.
2 Access was denied.
8 An unspecified failure occurred.
9 The name specified was invalid.
10 The object specified already exists.
11 The file system is not NTFS.
12 The platform is not Windows NT or Windows 2000.
13 The drive is not the same.
14 The directory is not empty.
15 There has been a sharing violation.
16 The start file specified was invalid.
17 A privilege required for the operation is not held.
21 A parameter specified is invalid.

See Also

Operating System Classes, Win32_NTEventlogFile