How do I Clear All Windows Event Viewer Logs using cmd, PowerShell, c# or VBScript WMI?

Alex Lim
Alex Lim
Dec 17, 2018 · 2 min read

Windows Event Viewer displays all the detailed information such as Errors, Warnings and even normal activities. Event Log at times doesn’t automatically remove all the information it stores, and that can be a problem for your computer’s performance as well. This article will show you how to quickly clear all Windows event logs in Event Viewer as needed in Windows 10 using command prompt, PowerShell script, c# command or VBScript / WMI.

Image for post
Image for post

Content Summary

Clear all Windows Event Viewer Logs using Command Prompt
Clear all Windows Event Viewer Logs using PowerShell
Clear all Windows Event Viewer Logs using C#
Clear all Windows Event Viewer Logs using BAT or CMD file
Clear all Windows Event Viewer Logs using VBScript / WMI

Step 1: Open Command Prompt and run it as administrator.

Step 2: Type or copy paste the following command into the elevated command prompt and press Enter:
for /F "tokens=*" %1 in ('wevtutil.exe el') DO wevtutil.exe cl "%1"

Image for post
Image for post

Step 1: Open an elevated PowerShell prompt.

Step 2: Type or copy paste below command into PowerShell window and press Enter.
wevtutil el | Foreach-Object {wevtutil cl "$_"} or

Get-EventLog -LogName * | ForEach { Clear-EventLog $_.Log }

Originally published at pupuweb.com on December 17, 2018.

E.T.

Insight and opinion on emerging technologies

Alex Lim

Written by

Alex Lim

Technology Blogger writing about emerging technologies (pupuweb.com) and marketing/lifestyle (paminy.com)

E.T.

E.T.

Insights, opinions, stories, tips, learnings, sharing concepts, news, analysis, resource, highlights, and ideas on emerging technologies.

Alex Lim

Written by

Alex Lim

Technology Blogger writing about emerging technologies (pupuweb.com) and marketing/lifestyle (paminy.com)

E.T.

E.T.

Insights, opinions, stories, tips, learnings, sharing concepts, news, analysis, resource, highlights, and ideas on emerging technologies.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store