Clear all Event Logs

(imported topic written by suresh.h@techsa.net)

Hi team,

How to clear all Event Logs.

Thanks…

(imported comment written by SystemAdmin)

Assuming Windows since you didn’t mention the OS, I found the following via Google …

From

http://technet.microsoft.com/en-us/library/cc722318.aspx?ppud=4

Under

Windows 7

,

Windows Server 2008 R2

,

Windows Server 8 Beta

,

Windows Vista

use the command line … (presumably

Win 7

as well since the command exists)

wevtutil cl <LogName> [/bu: <backup_file_name>]

Windows XP seems to be a bit more convoluted, there is no command line tool to do it. I’ve found reference to WMI commands that will clear the logs …

See …

http://msdn.microsoft.com/en-us/library/Aa394593

No matter the OS version, I don’t believe there is a way to “clear all logs” with a single command line under Windows. You will need to clear each log one at a time, besides the logs vary between OS versions.

(imported comment written by SystemAdmin)

I did a little more digging … (slow morning in the office, don’t tell the Boss!)

WinXP -

http://www.windowsitpro.com/article/log-files/nt-gatekeeper-using-a-command-line-tool-to-clear-event-logs

Vista/Win7/2008 variants -

http://forums.cnet.com/7723-19411_102-378338/delete-all-event-logs-at-once-in-windows-7/

(imported comment written by SystemAdmin)

I was able to download the

ELSave

tool ZIP from

THIS SITE

and tested it on my Windows 7 workstation. The -C command was able to clear my Security log from the command line. I haven’t tested it beyond that.

elsave -l security -C