How to clear administrative events in event viewer?

How to clear administrative events in event viewer?

We can clear event viewer logs using my below video...

But we can't directly delete the administrative events. For that we have do little bit code... Don't afraid. it is very easy only... Please follow below steps.

1.Copy below code in the notepad and save as .bat extension. 
@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

2. Run this .bat file as admin...(Right click and run as admin). For more information please watch below video...

Please watch below video for live steps:
 If you have any queries or suggestions, please feel free to ask in comments section.
Share this post :

Post a Comment

Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.

 
Support : Ranga Rajesh Kumar
Copyright © 2012. ASP.NET Examples - All Rights Reserved
Site Designed by Ranga Rajesh Kumar