This post explains how to view or clear the Event Log in the Event Viewer (eventvwr.msc) on a Windows PC. Windows 11/10 OS may occasionally throw up errors, and at such times, you may want to get a deeper understanding of the errors. That’s where the Event Log comes into play. Event Log files basically store all information regarding past errors. The problem is that the Event Log sometimes doesn’t automatically remove all the information it stores, and that can be a problem.
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.
Read: How to use Event Viewer in Windows 11
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] Clear 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] Delete selected Event logs using the wevtutil tool
You can use the Command Prompt instead. So let us see 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 lets 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 to view and delete Event Viewer Saved Error Logs?
If you are a regular of Event Viewer and you frequently view many .evt or .evtx files in Event Viewer, you may have noticed that a large number of files end up accumulating under Saved Logs. These entries remain even if you delete the original .evt and .evtx files.
These Saved Logs are stored .xml format, in the ExternalLogs folder, which is hidden. To view this folder, first through the folder options, uncheck the hidden and system files options, and navigate to the following path:
C:\ProgramData\Microsoft\Event Viewer\ExternalLogs
You will see the .xml logs here. The contents of this folder are hidden so you must turn on Show Hidden Files and turn off Hide Protected Operating System Files to see them.
To open a saved event log, start Event Viewer. Now, in the Actions menu, click Open Saved Log and navigate to and select the Saved Log from its location.
You can delete the Saved Logs from the Actions Box. But when you delete the log from the Event Manager’s Actions Box, you are only removing it from the console tree; you are not deleting the log file from the system.
If you wish you can delete the logs from your system, you will have to navigate to the mentioned ExternalLogs folder and delete them manually. Make sure that the Event Viewer is closed when you delete these files.
Windows Event Viewer Plus, a portable freeware app that lets you view Event Logs faster than the default inbuilt Windows Event Viewer, may also interest you.
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 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.