Thursday, September 14, 2006

Eventquery.vbs on Windows 2000

I was looking for a way to query the event log on a Windows 2000 Server machine. References on the Microsoft site listed it in the resource kit. Other references at TechRepublic and VisualBasicScript.com led me to believe it was only on Windows XP and Windows 2003 Server.

I tried simply copying the eventquery.vbs file from a Windows XP Pro computer to the %windows%\system32 folder, however, on running the script, received the error, Unable to include the common module"CmdLib.Wsc". I copied the file cmdlib.wsc as well, to no avail.

The VisualBasicScript.com site led me to believe it was somehow registered in the registry. So I ran

C:\WINNT\system32>regsvr32 cmdlib.wsc

and lo, and behold, the script now runs.

C:\WINNT\system32>cscript eventquery.vbs /?
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

EVENTQUERY.vbs [/S system [/U username [/P password]]] [/FI filter]
[/FO format] [/R range] [/NH] [/V] [/L logname | *]

Labels:

2 Comments:

Anonymous Anonymous said...

Note that on Windows Server 2003 x64 edition, when accessing the directory C:\Windows\System32 from a 32 bit application (like Nant.exe or PSPad.exe), then the contents of the c:\Windows\SysWOW64 directory are actually returned!

Now eventquery.vbs and cmdlib.wsc are in the directory C:\Windows\System32, but not in the directory c:\Windows\SysWOW64.

Copying these files to the c:\Windows\SysWOW64 directory should allow eventquery.vbs to be called from nant.exe and other 32 bit applications.

7/19/2007 4:34 AM  
Blogger The Count said...

Awesome info thanks!

4/23/2012 5:33 PM  

Post a Comment

<< Home