Windows 7 Forums Search
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows 7. The Windows 7 forum also covers news and updates and has an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7 - Event Viewer One Click Clear



 

Event Viewer One Click Clear

How to Clear the Windows 7 Event Viewer with One Click
Published by Zardoc
09-19-2009
Default Event Viewer One Click Clear

How to Clear the Windows 7 Event Viewer with One Click

information   Information
This will show you how to create a command line shortcut that will clear all of the Event Viewer logs in one click.



Here is a batch file that can help you clear the event viewer in one click.
download
Download this file above..

Unzip on your desktop.

You can use the task scheduler to give it a high priority so you won't get a UAC prompt

See Brink's Tip HERE

Or, just copy this script and paste in notepad and save as Clean Viewer.BAT

Right click to run the file
Code:
@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 goto theEnd
:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
:noAdmin
exit




Published by
Mad Scientist

Join Date: Jan 2009
Location: Canada
Posts: 564
Zardoc has much to be proud ofZardoc has much to be proud ofZardoc has much to be proud ofZardoc has much to be proud ofZardoc has much to be proud ofZardoc has much to be proud ofZardoc has much to be proud ofZardoc has much to be proud ofZardoc has much to be proud of

Tutorial Tools
10-18-2009   #1
Zardoc


Windows 7 x64 Ultimate SP1
 
 


Added Virtual PC clean log.



My System SpecsSystem Spec
10-18-2009   #2
ratePV


Windows 7 SP1 x64
 
 


Very nice!

I clean the Event log because it gets full of error/warning events...

This will shorten the time needed to clean it out!

Thanks!
My System SpecsSystem Spec
10-18-2009   #3
Zardoc


Windows 7 x64 Ultimate SP1
 
 


That's the main reason why I created this script. Microsoft is supposed to re examine the viewer to make it less scary with usless warnings.

Happy to help.

My System SpecsSystem Spec
.


10-18-2009   #4
zigzag3143


WDP ONLY
 
 


Z

Really nice thanks
My System SpecsSystem Spec
10-18-2009   #5
Dinesh


Windows 7 Ultimate x64
 
 


Very nice.
My System SpecsSystem Spec
10-18-2009   #6
Zardoc


Windows 7 x64 Ultimate SP1
 
 


Pleasure guys.

There's some very good stuff in this section!!

My System SpecsSystem Spec
10-19-2009   #7
rsvr85


Windows 7 Ultimate x64
 
 


Very useful, thanks heaps Zardoc!!
My System SpecsSystem Spec
10-19-2009   #8
Zardoc


Windows 7 x64 Ultimate SP1
 
 


My pleasure.
My System SpecsSystem Spec
10-26-2009   #9
lightningltd


Windows 7 64-bit
 
 

Even shorter event clear script...

This is an even shorter script to clear the event logs and will cover new logs as well as the current ones (Don't remember who I got it from, but works fantastically):

Clear_All_Logs.bat
OR you could also paste the following into a new batch file:

@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! ^<press any key^>
goto theEnd
:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
:noAdmin
echo You must run this script as an Administrator!
echo ^<press any key^>
:theEnd
pause>NUL
My System SpecsSystem Spec
Comment

Event Viewer One Click Clear problems?



Tutorial Tools



Similar Threads for: Event Viewer One Click Clear
Windows 7 Tutorial Category
How To Clear Administrative Events Log - Event Viewer Performance & Maintenance
Event Viewer Chrashes browsing Event Logs Crashes and Debugging
Event Viewer Performance & Maintenance
Event 18 WHEA-Logger Error in Event Viewer Hardware & Devices
How to clear events in viewer? General Discussion


All times are GMT -5. The time now is 11:35 PM.



Windows 7 Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows 7" and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30