While Event Viewer is a tool that can be incredibly useful for examining all the events that take place in a computer, you may at times want to quickly clear all event viewer logs on your clients’ devices.
If the Windows Event Viewer is so important, why delete event viewer logs? Well, there are several reasons; one of which being that when accessing the event log file, anyone can see your private information. Therefore, if you wish to protect your clients’ privacy when it comes to everything that they’ve ever done on their computer, then deleting the event log every now and again is a great idea.
Well, we’re here to make your life just a tad easier by bringing you this easy-to-use script to clear all event logs in Windows!
This script clears all Windows event logs, permanently deleting everything you see in Event Viewer (eventvwr.exe), including System, Setup, Security, and all Applications.
It’s really important to note that with this script, every level will be deleted, and no backup will be made. If this seems like it may be problematic for you, please make sure to create a restore point just in case something goes wrong.
The Script:
Atera does not guarantee the integrity, availability, security, virus-free, safety, lawfulness, non-infringement, rights’ status, or functionality of the scripts. The use of the shared scripts is at your own risk. Scripts are provided “AS IS”. *
@echo off
for /F %%a IN (?wevtutil el?) DO (wevtutil.exe cl %%a >nul 2>&1)
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!
goto theEnd
:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
:noAdmin
echo You must run this script as an Administrator!
echo.
:theEnd
Technical Notes:
We recommend making a backup of your Viewer Event logs as running this script will delete all Event Viewer logs without backing them up.