Overclock.net › Member Blogs › Event Log Cleanup

Event Log Cleanup

Tired of the huge event log? Tired of having to clear each log one at a time? Here is a batch file to clear ALL event logs in one shot: (enjoy!)

(Save the below as Clear_All_Logs.bat in your root double click it to execute once saved):

@echo off
FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V
IF (%adminTest%)==(Access) goto noAdmin
for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
echo.
echo Event Logs have been cleared! ^
goto theEnd
:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
:noAdmin
echo You must run this script as an Administrator!
echo ^
:theEnd
pause>NUL

Comments

There are no comments yet
Overclock.net › Member Blogs › Event Log Cleanup