Windows 7 Forums


Windows 7: Event Viewer One Click Clear


Event Viewer One Click Clear

How to Clear the Windows 7 Event Viewer with One Click
Published 19 Sep 2009
Published by

Featured Tutorial

User Profiles - Create and Move During Windows 7 Installation
User Profiles - Create and Move During Windows 7 Installation

How to Create User Accounts on another Partition or Disk During Windows 7 Installation

Online Scanners - Scan Suspicious Files on your PC
Online Scanners - Scan Suspicious Files on your PC

How to Scan Suspicious Files using Online Scanners

Microsoft Account "Two-step Verification" - Turn On or Off
Microsoft Account "Two-step Verification" - Turn On or Off

How to Turn "Two-step Verification" On or Off for your Microsoft Account

User Profile - Customize During Installation
User Profile - Customize During Installation

How to Customize Default User Profile in Audit Mode

Secunia ONLINE Software Inspector
Secunia ONLINE Software Inspector

How to Scan for Common Software Vulnerabilities

Search - Find More with Filters and Operators
Search - Find More with Filters and Operators

How to Use Windows Search Filters and Operators to get better Search Results in Windows 7
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






Need more help? Try searching our extensive help and support site.
Loading
18 Oct 2009   #1
Zardoc

Windows 7 x64 Ultimate SP1
Canada
 
 

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
Canada
 
 

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)
Mumbai, India
 
 

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

Windows 7 x64 Ultimate SP1
Canada
 
 

Pleasure guys.

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

My System SpecsSystem Spec
19 Oct 2009   #7
rsvr85

Windows 7 Ultimate x64
C:\Users\Home
 
 

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

Windows 7 x64 Ultimate SP1
Canada
 
 

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 problems?



Tutorial Tools



Similar help and support threads for: Event Viewer One Click Clear
Windows 7 Tutorial Category
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
Solved Event Viewer Error Message Event ID10 - How to get rid of it? BSOD Help and Support
Event 18 WHEA-Logger Error in Event Viewer Hardware & Devices


All times are GMT -5. The time now is 08:17 AM.


Seven Forums Android App Seven Forums IOS App Follow us on Facebook

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