Dharmendra's Blog

Just another WordPress.com site

Category Archives: Uncategorized

Huge List of Big Data and Machine Learning Technologies

WMI Tasks: Event Logs

Clear Event Logs:

Link: http://msdn.microsoft.com/en-us/library/windows/desktop/aa394593%28v=vs.85%29.aspx

VB Script
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
    WScript.Echo "Cleared application event log file"