China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 00:41
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Regarding the issue of reading Log Event with WSH scripts. View 1,770 Replies 5
Original Poster Posted 2006-08-18 16:51 ·  中国 江苏 苏州 电信
中级用户
★★
过度热情
Credits 321
Posts 139
Joined 2006-03-21 17:19
20-year member
UID 52521
Gender Male
Status Offline
I want to achieve the following operations but don't know how to start. I can't find relevant materials.

Note that it's implemented with a script, not by manual export methods.

1: Save all local log events to a text file or an Excel file.

2: Query the local log events, respectively by (Type Date Time Source Category Event User Computer) to find. For example, find the detailed message of the event with ID 1000.
Floor 2 Posted 2006-08-18 17:57 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
My usual practice is to run logfiles and then look at them one by one, heh

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 3 Posted 2006-08-18 21:44 ·  中国 湖北 荆门 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline
Well, under the %windir%\system32 directory, the system comes with a vbs script Eventquery.vbs. Using this script, the requirements you mentioned can be met. The system requires it to be run under cscript.exe. You can use a format like cscript %windir%\system32\eventquery.vbs + parameters to use it.
For example:

cscript %windir%\system32\eventquery.vbs /?
cscript %windir%\system32\eventquery.vbs /l system
Floor 4 Posted 2006-08-20 09:26 ·  中国 江苏 苏州 电信
中级用户
★★
过度热情
Credits 321
Posts 139
Joined 2006-03-21 17:19
20-year member
UID 52521
Gender Male
Status Offline
Floor 5 Posted 2006-10-21 07:58 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
  Great! I've learned a lot.

  It seems there are many things in the system worth our discovery and utilization.
Floor 6 Posted 2006-10-21 08:22 ·  中国 台湾
初级用户
Credits 36
Posts 11
Joined 2006-09-26 22:47
19-year member
UID 63740
Status Offline
Actually, you can back up the eventlog with a WSH script. I used the dumpel.exe tool from the Windows Server Resource Kit in combination because the log records exported by the WSH script are.evt files, not plain text files, and they can only be opened with Event Viewer. Opening them with a text editor will result in garbled text. To make it easy to view, I used the dumpel.exe tool to export the log to a txt file. The WSH script you mentioned is available on Microsoft's website! Thanks
Forum Jump: