This post explains how to clear the Event Log on a Windows PC. Windows 11/10 is known for acting up now and again with several types of errors. Now, you may want to get a deeper understanding of the errors, and that’s where the Event Log comes into play. Event Log files basically store all information regarding past errors for your viewing pleasure, and that’s great. The problem is, that the Event Log at times doesn’t automatically remove all the information it stores, and that can be a problem for your computer’s performance.
To fix this, users must manually clear the Event Log. Do you know what? Most computer users have no idea of how to do this. Worry not; we’ll help you through the entire process, and when we’re done, you’ll be a master.
Clear the Event Log in Windows 11/10
This post shows you how to clear the Event Log files via the Event Viewer UI or the Command line. You can delete all or selected even log files also from your Windows/Server, by following the steps laid down in this tutorial.
1] Delete the Event Log using the Event Viewer
Click on the Start button then type eventvwr.msc or Event Viewer. When you see the icon, right-click on it and select Run as Administrator to launch the Event Viewer. Finally, double-click on the folders in the left pane, right-click on the events you want to have deleted, and then choose Clear Log. This will clear all log files for that section. You may also select a log file and then click on Clear log which you see on the right-side panel.
2] Clear selected Event logs using the wevtutil tool
I love to use the Command Prompt instead of the regular ways of doing things. In that case, we will talk about how to clear the Event Log using the Command Prompt on a Windows 11/10 PC.
Click on the Start button, then type cmd and you’ll see the CMD icon. Right-click on the icon, then select Run as Administrator to fire up the Command Prompt.
The next step, then, is to type wevtutil el
into the newly opened Command Prompt window and make sure to do this without the quotes. Click the Enter key on your keyboard, and in a moment, you should see a list of all the error logs that have been exported.
Finally, type wevtutil cl + the name of the log you want to remove. This option allows you to clear only the logs you do not want, so don’t expect it to clear everything at the same time.
WEVTUTIL.exe is a built-in tool that enables you to retrieve information about event logs and publishers. You can also use this command to install and uninstall event manifests, run queries, and export, archive, and clear logs.
Read: How to export Event Viewer logs in Windows
3] Remove all Event Log files using a .CMD file
To clear everything, launch the Notepad application then copy and paste the following piece of information which has been sourced from MSDN:
@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
Be sure to save the data as a .bat file, then finally, right-click on the saved file and select Run as Administrator. From there, the Command Prompt should launch by itself, and all you need to do is allow it to finish doing its stuff.
I hope this helps!
How to clear out the Event Logs in Windows?
To clear all event logs that have entries in Windows, open an elevated PowerShell prompt and execute the following:
Get-EventLog -LogName * | where {$_.Entries.Count -gt 0} | foreach {Clear-EventLog $_.Log}
Read: Enable or disable Protected Event Logging in Windows.
How do I delete the Windows activity log?
Press Win + I to open the Settings app. Click on Privacy & security in the left panel. Scroll down and select Activity history. Click the Clear history button next to the ‘Clear activity history for this account’ option. This will delete the activity history stored on your device. To delete activity history stored online in your Microsoft account, go to your Microsoft Privacy Dashboard. You will see various categories, such as Browsing and search, Apps and services, etc. Click the category for the type of data you want to delete and select the Clear all activities option.
What is clear event log?
The Clear-EventLog
cmdlet in PowerShell deletes all entries from a specified event log on a local or remote computer. It lets you clear event logs such as Application, System, Security, or a custom log. The cmdlet can be helpful for maintenance tasks, troubleshooting, or clearing out no longer required logs. Clearing event logs permanently deletes all entries in the specified log, so it’s essential to use the Clear-EventLog
cmdlet carefully and only when necessary.
Related reads that are sure to interest you:
- How to view and delete Event Viewer Saved Logs in Windows
- How to view Event Logs in Windows in detail with Full Event Log View
- Use Event Viewer to check unauthorized use of Windows computer
- How to create Custom Views in Event Viewer on Windows
- Enhanced Event Viewer for Windows from Technet
- Event Log Manager Free event log management software
- Monitor Windows Event Log Files Checking with SnakeTail Windows tail utility
- Event Log Manager & Event Log Explorer software.