why does ExecQueryAsync work for XP and 2003, but not for W2K

Posted: 01-19-2005, 08:45 PM
I've noticed that when I try to use the "ExecQueryAsync" it doesn't seem to
work quite right in 2000. For one, the "winmgmts" process goes to about 50%
for about 5 minutes.

For some reason on W2K, it never seems to get the SINK_OnCompleted. But
this same code works great on both XP and 2003

Here is the code I'm using:

objWMIService.ExecQueryAsync objSink,"SELECT * FROM Win32_NTLogEvent WHERE
Logfile = '" & eventLog & "' AND TimeWritten >= '" & startDateArg & "' AND
TimeWritten < '" & endDateArg & "'"

objPopup = WshShell.Popup("Retrieving events", 10 ,"Event Retrieveal",
OK_BUTTON)

Sub SINK_OnCompleted(iHResult, objErrorObject, objAsyncContext)
WScript.echo "Asynchronous operation is done."
End Sub

Sub SINK_OnObjectReady(objEvent, ObjAsyncContext)
wscript.echo "Category: " & objEvent.Category
Wscript.Echo "TimeGenerated: " & objEvent.TimeGenerated
objFileWrite.WriteLine ("Category: " & objEvent.Category)
objFileWrite.WriteLine ("Computer Name: " & objEvent.ComputerName)
objFileWrite.WriteLine ("event Code: " & objEvent.EventCode)
objFileWrite.WriteLine ("message: " & objEvent.Message)
objFileWrite.WriteLine ("TimeGenerated: " & objEvent.TimeGenerated)
objFileWrite.WriteLine ("TimeWritten: " & objEvent.TimeWritten)
End Sub

Any ideas greatly appreciated
Reply With Quote

Responses to "why does ExecQueryAsync work for XP and 2003, but not for W2K"

 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vista on SBS 2003 Kerry Brown Windows Vista Networking & Sharing 2 01-03-2007 08:49 PM
HP LaserJet 1010 don't work in Vista since Beta2 - Advanced 1384 Printing Support drivers for XP don't work Alexey Windows Vista Printers & Scanners 2 10-19-2006 01:05 AM
Connecting to Vista Workgroup PC via Windows 2003 Doesn't work . . TRoN Windows Vista Networking & Sharing 1 09-14-2006 10:52 AM
mail merge won't work - Beta 2, WordXP, Outlook 2003 Steve Howard Windows Vista Mail 6 06-18-2006 04:50 PM
remote desktop doesn't work and netmeeting work ilan Windows XP Work Remotely 5 07-22-2003 01:26 AM


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90