Executes a query and writes the output records to an output format.
bResult = objLogQuery.ExecuteBatch(strQuery [, objInputFormat [, objOutputFormat ] ]);
JScript example:
var oLogQuery = new ActiveXObject("MSUtil.LogQuery"); // Create Input Format object var oEVTInputFormat = new ActiveXObject("MSUtil.LogQuery.EventLogInputFormat"); oEVTInputFormat.direction = "BW"; // Create Output Format object var oCSVOutputFormat = new ActiveXObject("MSUtil.LogQuery.CSVOutputFormat"); oCSVOutputFormat.tabs = true; // Create query text var strQuery = "SELECT TimeGenerated, EventID INTO C:\\output.csv FROM System"; strQuery += " WHERE SourceName = 'Application Popup'"; // Execute query oLogQuery.ExecuteBatch( strQuery, oEVTInputFormat, oCSVOutputFormat );VBScript example:
Dim oLogQuery Dim oEVTInputFormat Dim oCSVOutputFormat Dim strQuery Set oLogQuery = CreateObject("MSUtil.LogQuery") ' Create Input Format object Set oEVTInputFormat = CreateObject("MSUtil.LogQuery.EventLogInputFormat") oEVTInputFormat.direction = "BW" ' Create Output Format object Set oCSVOutputFormat = CreateObject("MSUtil.LogQuery.CSVOutputFormat") oCSVOutputFormat.tabs = TRUE ' Create query text strQuery = "SELECT TimeGenerated, EventID INTO C:\output.csv FROM System" strQuery = strQuery & " WHERE SourceName = 'Application Popup'" ' Execute query oLogQuery.ExecuteBatch strQuery, oEVTInputFormat, oCSVOutputFormat
© 2004 Microsoft Corporation. All rights reserved.