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

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
Windows 7 Tutorial Category
Event Viewer Event Id 2002, Source: EapHost, Log Application
Well, I tryed to manage page-file but unfortunataly it resulted in problems. Then I lost VAIO-CARE and 7 ZIP files too. When I open Event Viewer every single day I see this: event Id 2002, Souce: Eap Host, Log name: Application and number of Eventes: 84. As I am desparate about that, What sould...
General Discussion
Event Viewer: Clear All Events
How to Clear all Event Logs in Event Viewer using Windows PowerShell This tutorial will show you how to quickly clear all event logs in Event Viewer with a one line PowerShell script. This one line command clears each log in the Event log list one at a time. wevtutil el gets the Event log...
Tutorials
BSOD when watching videos on youtube, Event 41 in Event Viewer
It's been a while since I've experienced a BSOD as I'm viewing a video on youtube. It would freeze as if the audio was caught in mid-stream then BSOD, then would restart automatically. I go to Event Viewer after windows as loaded and I see Event 41 Kernel-Power in there. I had this issue...
BSOD Help and Support
After BSOD Event Viewer Logs Event ID 3012 and 3011 every time I boot
I was running 3DMark06 and got a BSOD code 124. After that every time I boot Event Viewer logs Error Codes ID 3012 and 3011. Attached are screenshots of both. I googled this and found two different threads where someone suggested to rebuild the performance counters. Both responses were...
BSOD Help and Support
How To Clear Administrative Events Log - Event Viewer
Hi: Does anyone know how to clear the Administrative Events log listed under Custom Views in the Event Viewer? All the logs listed under the Windows logs have options to clear, but the above does not. Thanks, ColTom2
Performance & Maintenance
WHEA-Logger event 18/19 errors in Event Viewer (W7 Home Premium)
Hi, I was hoping somebody could offer an insight on the below, as searching around I've not found much to go on other than "overheating" Basically my laptop has been having very high temperatures for a long time (usually ~60C for CPU and often 100-110 for GPU...insanely high, in other words)...
Hardware & Devices

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 23:02.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App