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


19 Sep 2009   #39
Zardoc

Windows 7 x64 Ultimate SP1
 
 
Event Viewer One Click Clear

How to Clear Event Viewer with One Click in Windows


...

My System SpecsSystem Spec
09 Sep 2011   #40
Zardoc

Windows 7 x64 Ultimate SP1
 
 

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
 
 

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
 
 

My Bad, second one.

Sorry
My System SpecsSystem Spec
10 Dec 2011   #45
barbarossa2241

windows 7 home premium 64bit
 
 

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

Windows 7 x64 Ultimate SP1
 
 

Hi barbarossa2241,

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

win7 Ultimate 64
 
 

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

Windows 7 x64 Ultimate SP1
 
 

Hi Korea7 ,

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

Windows 7 Home Premium 64 bit
 
 

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




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 01:16 PM.
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