Key Points
- You can clear the event logs from Event Viewer. Open Event Viewer, expand “Windows Logs”, right-click on a category, and click “Clear Log”.
- Alternatively, you can use the command for /F “tokens=*” %1 in (‘wevtutil.exe el’) DO wevtutil.exe cl “%1” in Command Prompt, or Get-EventLog -LogName * | ForEach { Clear-EventLog $_.Log } in PowerShell.
Windows Event Logs are records of the different events happening on the device relating to apps, security, power on/off, etc. Windows automatically maintains a list of activities, which is stored away in small files, accessible via the native Windows Event Viewer, or some other third-party apps.
However, while performing system maintenance, or for whatever reason, you may want to clear certain event logs so history is no longer available to view. There are several methods to do this, which have been discussed in this post.
Table of Contents
Why clear event logs?
As mentioned, event logs are compact files saved on the system. With time, these can grow huge in numbers, taking up storage space. To free up storage space, you may want to clear the event logs.
In other cases, people simply clear the event logs when thoroughly performing a maintenance routine to clear up old data on the PC.
That said, one might also want to clear the Windows event logs so that the record is no longer available for anyone else to check.
Clear the event logs using Event Viewer
The Event Viewer is a built-in utility in Windows that allows users to view the machine’s event logs. This can give all the activity history of the computer and any errors or warnings that occurred. This utility is especially useful for sysadmins and power users to troubleshoot any computer issues, which may occur deep within the roots, but can also be used to erase the event history of the PC.
We can see the information in event logs through the Event Viewer. You can access the Event Viewer by running “eventvwr.msc” in the Run Command box or using the Windows Key + X + V shortcut keys if you are using Windows 8 or higher.
Here are the steps to clear the event logs with Event Viewer:
-
Open the Event Viewer by running “eventvwr.msc” in the Run Command box.
-
Expand “Windows Logs” from the left pane.
-
Right-click the category that you want to clear and then click “Clear log“.
-
When asked for confirmation, click Clear.
Optionally, you can save the log file first and then delete the logs by clicking “Save and clear“.
After performing these steps, the logs for that specific category will be deleted. You can repeat these steps for other categories as well.
Clear event logs from Command Prompt
If you are a fan of the Windows command line, then you can use the Command Prompt (or PowerShell) to clear all event logs with a single command. Here is how:
-
Press the Windows Key + R to launch the Run Command box.
-
Type in “cmd” and press CTRL + Shift + Enter to launch an elevated Command Prompt.
-
Now execute the following command:
for /F "tokens=*" %1 in ('wevtutil.exe el') DO wevtutil.exe cl "%1"
This command will take a moment to execute completely, after which all event logs will be cleared, and the system will begin making new ones from here on out.
Clear event logs using PowerShell
Similar to Command Prompt, you can also clear all event logs using PowerShell. Here is how:
-
Launch an elevated PowerShell instance.
-
Run the following command:
Get-EventLog -LogName * | ForEach { Clear-EventLog $_.Log }
After running this command, no output will be shown However, the event logs will be silently cleared off.
Clear Windows event logs with Batch File
I have also compiled a batch file that will automate the task of clearing all Windows event logs for you. All you must do is download the file, extract its contents, and run the .BAT file with administrative privileges. The batch file is completely safe and has been tested by me.
Here are the steps:
-
Start by clicking on the following link to download the file:
Clear Event Viewer Logs (368 bytes, 166 hits)
-
Once downloaded, right-click the file and click “Extract All“.
-
Specify a path to extract the contents and click Extract.
-
Once extracted, right-click the .BAT file and click “Run as administrator“.
-
Wait for the batch file to execute completely.
Once done, all Windows log files will be removed from your PC.
Clear Windows event logs using CCleaner
CCleaner is a free, third-party tool that provides cleaning capabilities of different kinds. It can be used to optimize the PC, clear up storage space, check the system’s health, and much more.
While CCleaner can clean most types of crap and junk files from the system, it also includes the capability of automatically deleting the event logs. If you do not monitor and see the event logs, you can delete them safely to keep your system clean. Here is how:
-
Download the CCleaner software and install it on your system.
Note that the free version is sufficient to clear the Windows log files.
-
In the app, switch to the “Custom Clean” tab.
-
Scroll down and select “Windows Event Logs” under the Advanced section.
This will open the warning dialog telling you that checking this option will clear the Windows event logs. Press the OK button.
-
Click “Run Cleaner“.
-
When asked for confirmation, click “Continue“.
This will clean the junk files from the system along with the Windows event logs.
Ending words
Clearing the Windows Event Logs might not be required by everyone. In fact, very few people do this. However, if you find limited storage space on your PC, or are generally cleaning it up, then cleaning out the old event logs should be on your list.