Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide 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 Event Viewer with One Click in Windows
Published by Zardoc
19 Sep 2009
Published by

How to Clear Event Viewer with One Click in Windows


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, and click on Run as administrator 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







18 Oct 2009   #1
Zardoc

Windows 7 x64 Ultimate SP1
 
 

Added Virtual PC clean log.



My System SpecsSystem Spec
18 Oct 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
18 Oct 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
.


18 Oct 2009   #4
zigzag3143

Win 8 Release candidate 8400
 
 

Z

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

Windows® 8 Pro (64-bit)
 
 

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

Windows 7 x64 Ultimate SP1
 
 

Pleasure guys.

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

My System SpecsSystem Spec
19 Oct 2009   #7
rsvr85

Windows 7 Ultimate x64
 
 

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

Windows 7 x64 Ultimate SP1
 
 

My pleasure.
My System SpecsSystem Spec
26 Oct 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




Tutorial Tools



Similar help and support threads for2: Event Viewer One Click Clear
Windows 7 Tutorial Category
In Event Viewer, Where is event log for cleanmgr.exe (Disk Cleanup)? Performance & Maintenance
Solved Event Viewer Warning - Source e1yexpress - Event ID 27 General Discussion
How To Clear Administrative Events Log - Event Viewer Performance & Maintenance
WHEA-Logger event 18/19 errors in Event Viewer (W7 Home Premium) Hardware & Devices
Event Viewer Error Message Event ID11 - How do I get rid of this to? BSOD Help and Support
Event 18 WHEA-Logger Error in Event Viewer Hardware & Devices
How to clear events in viewer? General Discussion

Our Sites

Site Links

About Us

Find Us

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

All times are GMT -5. The time now is 03:13 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

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 31 32 33