Windows Event Logs is an essential information source to solve software failures/crashes in Windows. It is very useful to find main reasons of problems.
You may want to delete all of the eventlogs for some reason. Then following piece of code will become handy:
Option 1:Save as a BAT file (eg. clear-eventlogs.bat) and execute this batch file:
@echo off for /f %%x in ('wevtutil el') do wevtutil cl "%%x" && echo Cleared: %%x echo. && pause
- OR -
Option 2:Directly execute from command line:
@echo off && (for /f %x in ('wevtutil el') do wevtutil cl "%x" && echo Cleared: %x) && @echo on