Computer Tips & TricksWindows Tutorials

How to Clear Event Viewer Logs Using PowerShell or Wevtutil in Windows 7,8,8.1,10 & 11?

Hi Guys, Today I am Going to tell you How to Clear Event Viewer Logs Using PowerShell or Wevtutil in Windows 7,8,8.1,10 & 11?

Check Out This: How to Install & Run Google Playstore in Windows 11 Without Using any Emulators?

Are you Looking for the Commonly Searched Term “How to Clear Event Viewer Logs in Windows 7,8,8.1,10 & 11” (or) “How to Delete All Event Logs in Windows System”?

You are at the Right Place to Get Your Answers & Solve the Issue/Error.

Let’s See About it. 

Steps For How to Clear Event Viewer Logs Using PowerShell or Wevtutil in Windows 7,8,8.1,10 & 11?

 

Method 1: Delete All Event Viewer Logs Using BAT file

Step 1: Copy-Paste the Below Given Code into the Notepad and Save it as Filename.bat file on your Desktop.

@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 All Event Logs have been cleared!
goto theEnd

:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof

:noAdmin
echo Current user permissions to execute this .BAT file are inadequate.
echo This .BAT file must be run with administrative privileges.
echo Exit now, right click on this .BAT file, and select "Run as administrator".  
pause >nul

:theEnd
Exit

How to Clear Event Viewer Logs Using PowerShell or Wevtutil in Windows 7,8,8.1,10 & 11?

Step 2: Right-click on the .bat file and Run it as Administrator.

A New Command Prompt Window will Appear to Clear the event logs and it will automatically close when finished.

(or)

Simply Download the .bat File via the below given link.

Clear Events Viewer Logs.bat

 

Method 2: Delete All Event Viewer Logs Using Command Prompt

Step 1: Search for Command Prompt and Run it as Administrator and Copy-Paste the Below Given Code into the Command Prompt and Press Enter.

for /F "tokens=*" %1 in ('wevtutil.exe el') DO wevtutil.exe cl "%1"

How to Clear Event Viewer Logs Using PowerShell or Wevtutil in Windows 7,8,8.1,10 & 11?

 

Method 3: Clear Individual Event Viewer Logs Using Event Viewer 

Step 1: Press the Win + R keys to open the Run Program and type eventvwr.msc and click OK to open Event Viewer.

(or)

Step 1: Goto Windows Search and Enter Event Viewer and Run it.

Step 2: Now Click on the Windows Logs and Right Click on a Log (Example: Application) and Select the Clear Log Option and Hit the Clear Button When Confirmation Windows Prompts.

(or)

Step 2: Now Click on the Windows Logs and select a Log (Example: Application) and Select the Clear Log Option from the Right Action Panel and Hit the Clear Button When Confirmation Windows Prompts.

 

Method 4: Clear All Event Viewer Logs Using Powershell

Step 1: Search for Windows Powershell and Run it as Administrator and Copy-Paste the Below Given Code into the Command Prompt and Press Enter.

Get-WinEvent -ListLog * | where {$_.RecordCount} | ForEach-Object -Process { [System.Diagnostics.Eventing.Reader.EventLogSession]::GlobalSession.ClearLog($_.LogName) }

(or)

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

(or)

wevtutil el | Foreach-Object {wevtutil cl "$_"}

 

That’s It. You’re Done. Have a Nice Day.

@@@ Leave Comments @@@

##Stay Safe Guys And Live Happily ##

Show More

Author

Basically an Instrumentation Engineer But Very much Interested in Blogging. I'm a Passionate Blogger and an Expert in Search Engine Optimization And Always Looking Forward to Learn New Things. I Would Fix & Provide Solution to the Most Common Issues Related to PC,Laptops,Mobiles,OS, Hardwares and Softwares.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
Close

Adblock Detected

Please consider supporting us by disabling your ad blocker!