How To Clear Event Logs In Windows

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.

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:

  1. Open the Event Viewer by running “eventvwr.msc” in the Run Command box.

  2. Expand “Windows Logs” from the left pane.

    Expand Windows Logs
    Expand Windows Logs
  3. Right-click the category that you want to clear and then click “Clear log“.

    Clear event logs from Event Viewer
    Clear event logs from Event Viewer
  4. When asked for confirmation, click Clear.

    Optionally, you can save the log file first and then delete the logs by clicking “Save and clear“.

    Confirm clearing logs
    Confirm clearing logs

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:

  1. Press the Windows Key + R to launch the Run Command box.

  2. Type in “cmd” and press CTRL + Shift + Enter to launch an elevated Command Prompt.

  3. Now execute the following command:

    for /F "tokens=*" %1 in ('wevtutil.exe el') DO wevtutil.exe cl "%1"
    Clear all event logs using Command Prompt
    Clear all event logs using Command Prompt

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:

  1. Launch an elevated PowerShell instance.

  2. Run the following command:

    Get-EventLog -LogName * | ForEach { Clear-EventLog $_.Log }
    Clear all event logs using Windows PowerShell
    Clear all event logs using Windows PowerShell

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:

  1. Start by clicking on the following link to download the file:

    How To Clear Event Logs In Windows 1  Clear Event Viewer Logs (368 bytes, 2 hits)

  2. Once downloaded, right-click the file and click “Extract All“.

  3. Specify a path to extract the contents and click Extract.

  4. Once extracted, right-click the .BAT file and click “Run as administrator“.

    Run batch file with elevated privileges
    Run batch file with elevated privileges
  5. 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:

  1. Download the CCleaner software and install it on your system.

    Note that the free version is sufficient to clear the Windows log files.

  2. In the app, switch to the “Custom Clean” tab.

    Open the Custom Clean tab
    Open the Custom Clean tab
  3. 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.

    Select Windows Event Logs
    Select Windows Event Logs
  4. Click “Run Cleaner“.

  5. 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.

If you liked this post, Share it on:
Usman Khurshid is a seasoned IT Pro with over 15 years of experience in the IT industry. He has experience in everything from IT support, helpdesk, sysadmin, network admin, and cloud computing. He is also certified in Microsoft Technologies (MCTS and MCSA) and also Cisco Certified Professional in Routing and Switching.

Leave the first comment

Get Updates in Your Inbox

Sign up for the regular updates and be the first to know about the latest tech information