Batch file to clear the event viewer file

Archived from groups: microsoft.public.win2000.advanced_server (More info?)

Is there a way to make a batch file to clear the event
viewer each monday at 18:00.
Now I use dumpel to log all the event that I want.

Thanx a lot!
1 answer Last reply
More about batch file clear event viewer file
  1. Archived from groups: microsoft.public.win2000.advanced_server (More info?)

    "Patrick Bonneau" <anonymous@discussions.microsoft.com> wrote in message news:<372e01c4295b$177eb880$a101280a@phx.gbl>...
    > Is there a way to make a batch file to clear the event
    > viewer each monday at 18:00.
    > Now I use dumpel to log all the event that I want.


    Here is a VBScript file that can be run using the scheduler:

    ------
    strComputer = "."
    Set oWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate,(Security)}!\\" & _
    strComputer & "\root\cimv2")
    Set cLogFiles = oWMIService.ExecQuery _
    ("SELECT * FROM Win32_NTEventLogFile")
    For Each oLogfile in cLogFiles
    oLogFile.ClearEventLog()
    Next
    -------------

    --
    Matt Hickman
    congratulations and welcome to the the ranks of free men.
    I've been free a parcel of years now and I predict that you
    will find it looser but not always more comfortable.
    - Robert A. Heinlein _Citizen of the Galaxy_
Ask a new question

Read More

Event Viewer Microsoft Servers Windows