bludgard Posted August 23, 2010 Report Share Posted August 23, 2010 This .bat file will clear ALL logs in Event Viewer.Handy when you either have a decent running OS and want to start afresh,or need to pinpoint a problem without having to muck about in thousands of logs to try to find a particular event.Copy and Paste the following to Notepad:File>Save As>your preferred name followed by .bat:@echo offFOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%VIF (%adminTest%)==(Access) goto noAdminfor /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")echo.echo goto theEnd:do_clearecho clearing %1wevtutil.exe cl %1goto :eof:noAdminexitMicrosoft Batch File must be run under Administrator account or Run As Administrator.I know this works on Windows 7 OS.I cant say if it works on others. Quote Link to comment Share on other sites More sharing options...
-pops- Posted August 23, 2010 Report Share Posted August 23, 2010 To clear an event log by using Event Viewer Start Event Viewer.In the console tree, navigate to the event log you want to clear.On the Action menu, click Clear Log.You can either clear the event log or save a copy of the event log and then clear it.To clear the event log without saving: Click Clear.To clear the event log after saving: Click Save and Clear, type a name for the saved file in File name on the Save As dialog box and click Save. Quote Link to comment Share on other sites More sharing options...
bludgard Posted August 23, 2010 Author Report Share Posted August 23, 2010 I've tried clearing events log by log and still there would be entries in "Administrative Events" under Custom views.This is the only thing I've found to clear ALL event logs.Maybe I overlooked something-as usual.Yet I am pretty meticulous when I set my mind to do something.Thank you for adding reference to the option to save the log before clearing.That may be useful to some. ;) Quote Link to comment Share on other sites More sharing options...
-pops- Posted August 23, 2010 Report Share Posted August 23, 2010 We must always remember that an awful lot of computer users have no idea whatsoever about event logs - or anything else that cannot appear on screen with more than two mouse clicks.This comment is no negative reflection on those users, just that they don't have any interest or need to know. Quote Link to comment Share on other sites More sharing options...
MANEMAN Posted August 25, 2010 Report Share Posted August 25, 2010 Thanks for that blugarters.It's saved amongst my other BAT files. (In the bat cave, next to Robin's toothbrush.)@echo offFOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%VIF (%adminTest%)==(Access) goto noAdminfor /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")echo.echo goto theEnd:do_clearecho clearing %1wevtutil.exe cl %1goto :eof:noAdminexitWhat pops really meant to say was: "We must always remember that an awful lot of computer users have no idea whatsoever." :lol: Just in case some of them want to move forward along the path and learn. Here is a link: ** Event Viewer **John.(In Gotham City it is now accepted, and politically correct to call these people Morons ? )This comment is no negative reflection on those users. (In Gotham) :) Quote Link to comment Share on other sites More sharing options...
bludgard Posted August 25, 2010 Author Report Share Posted August 25, 2010 Thank you MANEMAN,for your colorful and enigmatic follow-up on this.IMO,it is always welcome.By the way,have you bound yourself from posting on Tuesdays?I seem to have acquired a small habit of looking for hilarious content on said day and can't seem to get my fix.I guess I either need to be patient (for this fix WILL be doled out eventually),or check into a local rehab. Quote Link to comment Share on other sites More sharing options...
Sarah Alberta Posted March 10, 2011 Report Share Posted March 10, 2011 Thank you all for replying. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.