Clear Windows Event Logs with the Windows Events Command Line Utility (wevtutil)
Ever find yourself sifting through specific event logs after debugging a script or application? Do you do the old “hurry up and switch to Event Viewer so I can catch new events” technique? With wevtutil, put this command in front of your script and enjoy event logs that are relevant from the time of execution forward:
wevtutil cl log_name /bu:backup_location_before_clear
wevtutil cl Security /bu:C:\security_backup.evt