Windows 7 Forums


Windows 7: Event Viewer One Click Clear

19 Sep 2009   #39
Zardoc

Windows 7 x64 Ultimate SP1
Canada
 
 
Event Viewer One Click Clear

How to Clear the Windows 7 Event Viewer with One Click

...


Last edited by Brink; 03 Nov 2011 at 10:12 PM..
My System SpecsSystem Spec

09 Sep 2011   #40
Zardoc

Windows 7 x64 Ultimate SP1
Canada
 
 

Quote   Quote: Originally Posted by devnulllore View Post
@Lightningltd

Great batch file! but I have always wondered, what's with the long pauses between various log clearings?

dev
Slow processor reaction. Mine slides like butter.

My System SpecsSystem Spec

03 Nov 2011   #41
RandyD123

Win7 x64
 
 

I have 3 edits of this file, which one is the best?

@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

--------------------------------------------------------------------------------------------

@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

---------------------------------------------------------------------------------------------

@echo off
FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V
IF (%adminTest%)==(Access) goto theEnd
for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
goto theEnd
:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
:theEnd


They all appear to do the same thing, but is any one of them "better" than the others?

My System SpecsSystem Spec
04 Nov 2011   #42
Zardoc

Windows 7 x64 Ultimate SP1
Canada
 
 

Hi there,

The last one is the best. It has all unecessary commands removed.


@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

My System SpecsSystem Spec
15 Nov 2011   #43
RandyD123

Win7 x64
 
 

Quote   Quote: Originally Posted by Zardoc View Post
Hi there,

The last one is the best. It has all unecessary commands removed.


@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


You say the last one but you show the second one in your post???
My System SpecsSystem Spec
.


17 Nov 2011   #44
Zardoc

Windows 7 x64 Ultimate SP1
Canada
 
 

My Bad, second one.

Sorry
My System SpecsSystem Spec
10 Dec 2011   #45
barbarossa2241

windows 7 home premium 64bit
Forest Hills , NY
 
 

Thanks a lot.
My System SpecsSystem Spec
11 Dec 2011   #46
Zardoc

Windows 7 x64 Ultimate SP1
Canada
 
 

Hi barbarossa2241,

You're welcome.
My System SpecsSystem Spec
16 Dec 2011   #47
KOREA7

win7 Ultimate
Korea
 
 

Nice Gift Thanks
My System SpecsSystem Spec
17 Dec 2011   #48
Zardoc

Windows 7 x64 Ultimate SP1
Canada
 
 

Hi Korea7 ,

You're welcome.
My System SpecsSystem Spec
07 Jan 2012   #49
Blappy

Windows 7 Home Premium 64 bit
Canada
 
 

I had so many errors and warning - this cleared them out...thanks a billion. Looking forward to browsing these forums for more info in the future!
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 04:20 PM.


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