From: Dave Patrick on
I'm sure there are many of them out there. Here's one.

http://msdn.microsoft.com/en-us/library/aa394593(VS.85).aspx



--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"boe"wrote:
> Hopefully someone will sell the script or post it as a freeware fix.
From: boe on
THanks - you think this clears ALL logs?


Use the Win32_NTEventlogFile class and the ClearEventLog method.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Backup)}!\\" & _
strComputer & "\root\cimv2")
Set colLogFiles = objWMIService.ExecQuery _
("Select * from Win32_NTEventLogFile " _
& "Where LogFileName='Application'")
For Each objLogfile in colLogFiles
objLogFile.ClearEventLog()
WScript.Echo "Cleared application event log file"
Next

"Dave Patrick" <DSPatrick(a)nospam.gmail.com> wrote in message
news:uZEF4$nzKHA.244(a)TK2MSFTNGP06.phx.gbl...
> I'm sure there are many of them out there. Here's one.
>
> http://msdn.microsoft.com/en-us/library/aa394593(VS.85).aspx
>
>
>
> --
>
> Regards,
>
> Dave Patrick ....Please no email replies - reply in newsgroup.
> Microsoft Certified Professional
> Microsoft MVP [Windows]
> http://www.microsoft.com/protect
>
> "boe"wrote:
>> Hopefully someone will sell the script or post it as a freeware fix.

From: boe on
I tried to run it on a test system as admin and got - clearlog.vbs(10, 5)
SWbemObjectEx: Access denied

"boe" <boe_d(a)nospammyhotmail.com> wrote in message
news:O9c2NSozKHA.6112(a)TK2MSFTNGP05.phx.gbl...
> THanks - you think this clears ALL logs?
>
>
> Use the Win32_NTEventlogFile class and the ClearEventLog method.
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate,(Backup)}!\\" & _
> strComputer & "\root\cimv2")
> Set colLogFiles = objWMIService.ExecQuery _
> ("Select * from Win32_NTEventLogFile " _
> & "Where LogFileName='Application'")
> For Each objLogfile in colLogFiles
> objLogFile.ClearEventLog()
> WScript.Echo "Cleared application event log file"
> Next
>
> "Dave Patrick" <DSPatrick(a)nospam.gmail.com> wrote in message
> news:uZEF4$nzKHA.244(a)TK2MSFTNGP06.phx.gbl...
>> I'm sure there are many of them out there. Here's one.
>>
>> http://msdn.microsoft.com/en-us/library/aa394593(VS.85).aspx
>>
>>
>>
>> --
>>
>> Regards,
>>
>> Dave Patrick ....Please no email replies - reply in newsgroup.
>> Microsoft Certified Professional
>> Microsoft MVP [Windows]
>> http://www.microsoft.com/protect
>>
>> "boe"wrote:
>>> Hopefully someone will sell the script or post it as a freeware fix.
>
From: Dave Patrick on
No, only the application event log. You'll need to modify or expand
functionality to fit your needs.


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"boe" wrote:
> THanks - you think this clears ALL logs?
>
>
> Use the Win32_NTEventlogFile class and the ClearEventLog method.
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate,(Backup)}!\\" & _
> strComputer & "\root\cimv2")
> Set colLogFiles = objWMIService.ExecQuery _
> ("Select * from Win32_NTEventLogFile " _
> & "Where LogFileName='Application'")
> For Each objLogfile in colLogFiles
> objLogFile.ClearEventLog()
> WScript.Echo "Cleared application event log file"
> Next

From: Dave Patrick on
Actually for vista / 2008 / 7 you'll probably want to use Wevtutil tool.

http://technet.microsoft.com/en-us/library/cc732848(WS.10).aspx



--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"boe" wrote:
>I tried to run it on a test system as admin and got - clearlog.vbs(10, 5)
> SWbemObjectEx: Access denied