Whatever happing on your Windows 10 PC is stored in Windows Event Viewer in Security, System, Application based on their criteria. details in the event log helpful when troubleshooting problems with Windows. However, you may also wish to be able to quickly Clear All Event Logs at once as needed.
Here are the methods to Clear All Event Logs in windows 10 in One-click:-
1.Clear All Event Logs using Command Prompt
Command Prompt is always my favorite tool that i used to perform the various task quickly, You are easily able to clear event viewer logs with Command Prompt also.
First, open the Elevated Command prompt by right-clicking on the Start menu and select “Command prompt (admin)”
and enter the below command and Press Enter
for /F “tokens=*” %1 in (‘wevtutil.exe el’) DO wevtutil.exe cl “%1”
It will start cleaning all Logs and within minutes, all event viewer logs will be cleared.
2.Clear event viewer using PowerShell
PowerShell is one of most powerful that is used to perform various task soo quickly same like Linux terminal.
Open Elevated PowerShell command, by searching PowerShell is search menu and Right-click on it and select “Run as administrator” option.
and enter the below commands
wevtutil el | Foreach-Object {wevtutil cl “$_”}
3.Clear event viewer using BAT File
You need to create a BAT file with below code,
@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 goto theEnd
:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
:noAdmin
exit
Open the Notepad and paste the above code, click on the File > Save as and in the “Save as type” select “All Files” and enter whatever name that you want’s and makefile extension.BAT.
and Right-click on your BAT file and select ‘Run as administrator” option and it will start cleaning.
Apart from Clear All Event Logs in windows 10, I want to show you where all these logs are stored in windows 10 ( Just for knowledge)
Open Event Viewer, and navigate to Windows logs and right-click on any menu like in my case I want to view application logs so I need to select application tab and select Properties.
Here it will show you Log path location, just copy below path
%SystemRoot%\System32\Winevt\Logs\
Enter in Run menu or Windows Explorer, it will open Log storage location. If you want to open the particular log file, just double-click on a particular log file.
Also, Check How to Take Windows 10 Drivers Backup Using Powershell
How to Always Run Powershell as an Administrator in Windows 10