How to Delete Win Log Files in Windows 10

Windows is always in the first number for the filling of storage in it. Various temporary files are made daily, for the decrease of load and the general performing of it. There also comes the time when things may go on the wrong side and also the error may occur in the Windows.

Windows 10 includes the various types of errors in its Event log, that can be easily accessed by the users for the extraction of error code and can do the performing of the troubleshooting steps appropriately. The event log will save the various information that can be resulted in the running out of space in your PC.

Here we will discuss the default event viewer path. Along with this, we will discuss the deleting of log files in your Windows 10 which will also include the clearing of all event logs in Powershell.

What are the Win Log Files in Windows 10?

When any of the error occurs in the program or the operation of noteworthy on the computer, then Windows will do the storing of a record of the happened troubleshoot. These records are then saved to the Log Files in the Windows directory. These Windows log files are called the Win log files.

Location of the Windows Log Files in Windows 10

Usually, it is easy to find the Windows log files in your Windows 10. The question now occurs that what is the event viewer default path and where are the event logs in the computer of Windows 10. This information will help you a lot at the time of troubleshooting of the computer or for the clearing of Windows log files.

As there are two folders and it all depends on the type of version of Windows you have where you can find the Windows log files.

Visit the folder of:-

%windir%\System32\Winevt\Logs\

If this doesn’t work, then visit the given location of this folder where you can easily look under this given folder:-

%windir%\System33\config\

Make sure that %windir% is the directory of the computer operating system.

How to do the deleting of the Win Log Files in Windows 10?

Windows 10 gives the try for the freeing up of the space in an automatic way. The Event Viewer gets fail in most of the moments in the clearing of the data. In such cases, you need to have a clear event log in Windows 10 in a manual form. There are many methods for the deleting of the log files in Windows  10.

3 Ways To Delete Win Log Files In Windows 10

In this article, we have guided three methods to delete log files in Windows. You can easily use only one method which you prefer such as command prompt, PowerShell, etc. To get rid of win log files without having a hassle.

Method 1: Use of Command Prompt

The command prompt is the command tool of Utility in Windows, which can be accessed for the performing of any of the tasks in Windows with the use of command lines. Through this, you can also do the use of Command Prompt for the clearing of event on the Windows 10. The command prompt can also be there for the use of clearing of the log files in individual forms or for the clarity of full event log in Windows 10.

Here we have the steps for the deleting of the Windows log files:-

Step 1

Firstly, open the elevated form of Command Prompt.  Make sure you run it as an administrator. You can open it by going to the Start Menu and then searching it from the Search bar. You can also run it from the Run dialog.

Screenshot 49

Step 2

After that, visit the event viewer default path which id mentioned upward by the use of change directory command:-

cd%windir%\system32\config

Step 3

For the clearing of every log files, type this command and then click on the Enter key:-

del*.log /a /s /q /f

Delete Log Files in Windows Using Command lines

The entire files which you have in your computer that are with a.log extension will now be deleted from the computer.

Delete Single Log Files Using Command Line

If you want, then you can also clear the log files of individual ones. Here we have the commands that you have to enter there:-

Step 1

Firstly, open another command prompt of the admin one.

Step 2

Then for the listing of log files, type this command and then click on the Enter button:-

.wevtutil el

Screenshot 50

Step 3

Now from the given list which appears on the screen, if you want to delete the required log file, then type the given command and then click on the Enter button:-

wevtutil cl <name of the log>

It will do the deleting of the required log from the given Event Viewer file.

Method 2 :

Making of a Command File for the automatic clearing of Log Files

When at the time you are trying for the new forms of experimenting of the features. Then there is a great chance for the generating of most of the win log files on the computer if this feature gets thrashed. In such time, you may be wondering how to delete the win log files in Windows 10 in an automatic way.

People can easily make the command file (.cmd) for the accessing of this process.

Here we have the process explained for performing of it:-

Step 1

Firstly, open the text editor which you can go through with the MS visual code or the Notepad.

Step 2

Now type there, the given code:-

@echo off
FOR /F “tokens=1,2*” %%V IN (‘bcdedit’) DO SET adminTest=%%V
IF (%adminTest%)==(Access) gotonoAdmin
for /F “tokens=*” %%G in (‘wevtutil.exe el’) DO (call :do_clear “%%G”)
echo.
echo Event Logs have been cleared! ^<press any key^>
gototheEnd
:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
:noAdmin
echo You must run this script as an Administrator!
echo ^<press any key^>
:theEnd
pause>NUL

Screenshot 51

Step 4

After that, save this command along with the extension of.cmd any of the location which you want.

Step 5

Then run this command file through the administrator by the selection of the correct option by right-clicking on the context menu.

People will get the command Prompt window on their screen. It will view that all of the log files are now cleared in an automatic form.

Method 3 :

Clearing All the Event logs by the use of PowerShell

Powershell is a powerful way of tool for command. You can use the single command for the deleting of log Files in your Windows 10.

Follow the given steps:-

Step 1

Open the Powershell through the Admin. You can open by going to the Start Menu and then searching Powershell from the given search bar.

Screenshot 52

Step 2

Then type the given command and then click on the Enter button:-

Wevtutil el l Foreach-Object {wevtutil cl “$_”} 

It will do the clearing of the every event logs in your Windows 10.

Other methods of Clearing Windows Log Files

There are two other methods for deleting the win log files. They are by the use of third party applications and by the use of Event Viewer GUI. Third-party applications include apps to be downloaded and then performing the cleaning and event viewer includes opening the run dialog. These methods were not mentioned here as the three given are much easier and better to access. For better access, perform these methods which will be better in using them.

Wrapping Things Up

This article title based on How to Delete Win Log Files in Windows 10. Now we better know how to clean the win log fils on Windows 10. We discussed various methods of deleting them. These methods can be performed easily as they were the easy steps which you will get to access on your Windows 10. Go through our more topics and tell us about this one in the comment section.

Related Articles:

How to Disable Superfetch in Windows 10

What is Windows 10 Lite Why Should I Use it?

5 Ways on Move A Window That is off Screen