Forum Discussion
Errors in Event Viewer
I gave up and added an event viewer log clear.
How do you do that?
- ZardocMar 30, 2026Copper Contributor
You create a task from your event you see that option on the right of your event viewer under actions. You have 2 choices that are similar on the right. Choose the lowest one under the event. It will open the task manager and assign the name of the event. Keep changing page until It will offer to start a program and ask where the program/Script is.
You want to have a .Bat file that cleans the event viewer automatically (that's the program). To create the bat file, open Notepad and paste this and save it as "Viewer.bat" on the root of a drive other than C: like D:\
@echo off
:: Set console color: 0 = black background, A = bright green text
color 0A
:: Check admin
whoami /groups | findstr /i "S-1-5-32-544" >nul 2>&1
if errorlevel 1 (
echo Please run as Administrator.
pause
exit /b
)
:: Loop over all logs and show progress
for /f "usebackq delims=" %%G in (`wevtutil el`) do (
echo %%G
wevtutil cl "%%G"
)
echo.
So it would look like this
"D:\Viwer.bat" Choose next and then when completed it will say that the task has been created and to modify it you need to go to Task manager. Go to Task manager (just type it in Start menu if you don't know where it is). It will be the folder called task from Event viewer (Or close to that I'm in French). find the event that looks like
OAlerts_Microsoft Office 16 Alerts_300
and right click on it and choose properties.
Right under your user name you will see launch instructions. Choose "Run whether user is logged on or not" and check "Run with highest privileges". Then click OK. It will ask you for your logon password (NOT YOUR PIN if are using one). This will let the Bat file run even when you are not logged in or after you log out.
If you follow that, your errors should not show up. 😉