Home Tutorials How to Delete Win Log Files in Windows 10

How to Delete Win Log Files in Windows 10

When you do something major on your Windows, it stores the record of the errors and other noteworthy files in a Windows directory. These log files are called Win log files. So, of course, you like to delete Win Log files in Windows 10.

However, for those who don’t know about these log files, they might start taking up space on the computer.’

How to Delete Win Log Files in Windows 10?

delete win log files in windows 10

There is a way through which these files can be deleted so that the user is able to free up disk space.

Method 1

  • Press the keys Win+R, and a window ‘run’ will open. Input the code eventvwr.msc, and then press enter to run that Event Viewer.

Delete Win Log Files in Windows 10

  • On the left pane, you will be able to expand the Window logs, and then click on one category.
  • Select the entries that you will in the middle pane, and then choose a series of entries, press ctrl+shift+enter, and then click on the clear log option that appears.

Method 2

The second method is to use a command prompt for deleting Win log files.

CMD in Windows 10

You need to run the Command Prompt with administrative privileges, and then type three commands; after each command, press Enter.

  • 1) cd/
  • 2) cd windows
  • 3) del*.log/a/s/q/f

CMD commands in Windows 10

3 Steps will delete the Win Log files on your PC.

The third method to delete Win Log files is to use a .CMD file. However, the coding for this is much complex and can be found online.

All you need to do is open your notepad on Windows 10, and run a command.

  • In Windows 10, another method to delete the Win log files is to open the Event Viewer GUI.

CMD in Windows 10

  • First, you need to open a Run dialog, and then tye ‘eventvmr.msc’ in it, and press ctrl+shift+enter.

Delete Win Log Files in Windows 10

  • You can expand the folders that appear on your left side and then click on the ‘clear log’ option.

clear all log files in Windows 10

  • You can repeat this option for all the entries that you want to delete.
  • While Windows 10 is able to free up space automatically, the Event Viewer fails most of the time in the task of clearing the data automatically.
  • In such cases, you will have to clear the event log in Windows 10 manually. There are some ways to delete log files in Windows 10.

How to Use Command Prompt to remove log files?

Here are some of the steps which you can follow to delete all of the Windows log files:

  1. Open an elevated command prompt. You can do this from the Windows search context menu, or you can also do this from a Run dialog (use the buttons Ctrl + Shift + Enter to launch cmd with admin privileges.
  2. Now, go to the even viewer default path which is mentioned above by using the change directory command:
    cd%windir%\system32\config
  3. Now, to clear all of the win log files, type the following command and then simply press Enter:
    del *.log /a /s /q /f
    All of the files with a .log extension will be deleted from your computer.

If you want to clear those log files individually, then here are the commands which you will need to enter:

  1. Open another admin command prompt.
  2. To list the log files, type the following command and press Enter:
    wevtutil el
  3. Now, from the list which appears, if you find a certain log file which you want to delete, type the following command and then press Enter:
    wevtutil cl <name of the log>

This will delete that particular log from the Event Viewer file.

Read more: How To Make a Post Shareable on Facebook?

How to Make a Command File to Automatically Clear Log Files?

make your PC fast Windows 10

When you are trying out new experimental features, there is a chance that you may be generating a lot of win log files on your computer if the feature crashes.

In these cases, you might be wondering how to delete those win log files in Windows 10 automatically.

You can make a command file (.cmd) to mechanize this process. Follow these steps to create this command file:

  1. Open a text editor like Notepad or MS visual code.
  2. Type the following code, or copy and paste this following in the editor.

@echo off

FOR /F “tokens=1,2*” %%V IN (‘bcdedit’) DO SET adminTest=%%V

IF (%adminTest%)==(Access) goto admin

for /F “tokens=*” %%G in (‘wevtutil.exe el’) DO (call :do_clear “%%G”)

echo.

echo Event Logs have been cleared! ^<press any key^>

goto theEnd

: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

  1. Save the name of this command with the extension .cmd in any location which you prefer.Delete Win Log Files in Windows 10
  2. Now, run this command file as an administrator, by choosing the correct option from the right-click context menu.

Read more: How To Disable Microsoft Family Features?

You will now see a command prompt windows will appear, and all of the log files are cleared automatically.

Note: Run this file as admin to clear event log files. Read more about CMD.

LEAVE A REPLY

Please enter your comment!
Please enter your name here