Clear all Administratative Event Logs in Event Viewer for Windows 10

G

GUNJAN TRIVEDI

1. Open Notepad

2. Copy And Paste following code


@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


3. Save as the file with .bat extension

4. Run the file as an Administrator

5. Enjoy

Continue reading...
 

Similar threads

G
Replies
0
Views
883
GuogangFan
G
N
Replies
0
Views
208
Nomad.CANAM
N
B
Replies
0
Views
494
Brandon LeBlanc
B
Back
Top Bottom