Are you a regular user of the Event Viewer in Windows 7? Ever wonder why Microsoft haven’t programmed it to clear itself after a certain amount of entries or time?
As it stands right now, I have tens of thousands of entries in the Event Viewer which is unnecessary and bogs down the loading time. Maybe for a corporate administrator this is required but for average Joe, it isn’t.
What is the Event Viewer?
“Windows NT has featured event logs since its original release in 1993. Applications and operating system components can make use of this centralized log service to report events that have taken place, such as a failure to start a component or complete an action. The system defines three log sources:
- “System”
- “Application”
- “Security”
Microsoft intends the System and Application log sources for use by the Windows operating system and Windows applications respectively. Only the Local Security Authority Subsystem Service (lsass.exe) can directly write to the Security log.”
With that out of the way, on with the guide to show you how to clear the Event Viewer.
Step 1.
Click the Start Menu and type notepad. Click on Notepad from the results.
Step 2.
Your new file should now look like this:
If it doesn’t and it looks like this:
Go back and try again.
Step 3.
Find the batch file we created a second ago and double click it. The command prompt window will now pop-up and run through the batch file commands. Let it finish and it will automatically close.
Now you can go ahead and open up the Event Viewer and have a completely clear view!
Alternatively, you can download the batch file here and run it in the same way.
Thanks!!! :-)
Thanks!!! :-)
Thanks!!! :-)
Thanks for your batch file!
I found another script that clears every single log file:
http://www.wilderssecurity.com/showpost.php?s=39f67ac9ade8cf585d0c8e0b0e411999&p=1613265&postcount=8
@echo off
for /F “tokens=1,2*” %%V IN (‘bcdedit’) DO SET adminTest=%%V
if (%adminTest%)==(Access) goto noAdmin
echo Clearing all Eventlogs
echo Please Wait…
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!
:theEnd
echo.
echo Press any key to exit
pause>nul
Thanks for your batch file!
I found another script that clears every single log file:
http://www.wilderssecurity.com/showpost.php?s=39f67ac9ade8cf585d0c8e0b0e411999&p=1613265&postcount=8
@echo off
for /F “tokens=1,2*” %%V IN (‘bcdedit’) DO SET adminTest=%%V
if (%adminTest%)==(Access) goto noAdmin
echo Clearing all Eventlogs
echo Please Wait…
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!
:theEnd
echo.
echo Press any key to exit
pause>nul
Thanks for your batch file!
I found another script that clears every single log file:
http://www.wilderssecurity.com/showpost.php?s=39f67ac9ade8cf585d0c8e0b0e411999&p=1613265&postcount=8
@echo off
for /F “tokens=1,2*” %%V IN (‘bcdedit’) DO SET adminTest=%%V
if (%adminTest%)==(Access) goto noAdmin
echo Clearing all Eventlogs
echo Please Wait…
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!
:theEnd
echo.
echo Press any key to exit
pause>nul
simple way type in cmd:
for /F “tokens=*” %1 in (‘wevtutil.exe el’) DO (wevtutil.exe cl “%1”)
Helps alot… Thank UUUUUUUUUUUUUUU
Greatly appreciated I got the same call repeatedly
Works great but I found out that I had to right click on the Clear Event Viewer.bat file and run as administrator for it to clear the entries
M$ IS RETARDED! WHY MUST YOU DO ALL OF THIS JUST TO CLEAR IT? WHY CAN’T THEY JUST HAVE A CLEAR ALL LOGS OPTION LIKE XP HAS?! MORONS!