Windows 10: Clear All Event Logs in Event Viewer in Windows

Discus and support Clear All Event Logs in Event Viewer in Windows in Windows 10 Tutorials to solve the problem; How to: Clear All Event Logs in Event Viewer in Windows How to Clear All Event Logs in Event Viewer in Windows Event Viewer is a tool that... Discussion in 'Windows 10 Tutorials' started by Joanne, Aug 15, 2015.

  1. Joanne Win User

    Clear All Event Logs in Event Viewer in Windows


    How to: Clear All Event Logs in Event Viewer in Windows

    How to Clear All Event Logs in Event Viewer in Windows


    Event Viewer is a tool that displays detailed information as event logs about significant events on your PC.

    Event logs are special files that record significant events on your PC, such as when a user signs in to the PC or when a app encounters an error. Whenever these types of events occur, Windows records the event in an event log that you can read by using Event Viewer.

    Advanced users might find the details in event logs helpful when troubleshooting problems with Windows and other apps. However, you may also wish to be able to quickly clear all event logs at once as needed.

    See also: Review events and errors using Event Viewer | Microsoft Docs

    This tutorial will show you how to quickly clear all event logs in Event Viewer as needed in Windows 10.

    *Warning You must be signed in as an administrator to be able clear all event logs.

    *note This will not clear Analytic or Debug logs. If you have them enabled, the wevutl command returns an error, but all other logs will be cleared.

    *note Clearing all Event Viewer logs will also clear Reliability History.


    CONTENTS:
    • Option One: To Clear All Event Viewer Logs using a BAT file
    • Option Two: To Clear All Event Viewer Logs in Command Prompt
    • Option Three: To Clear All Event Viewer Logs in PowerShell
    • Option Four: To Clear Individual Event Viewer Logs in Event Viewer

    EXAMPLE: Event Viewer

    Clear All Event Logs in Event Viewer in Windows [​IMG]







    OPTION ONE [/i] To Clear All Event Viewer Logs using a BAT file
    1. Click/tap on the Download button below to download the .bat file below.
    Clear_Event_Viewer_Logs.bat

    Download
    2. Save the .bat file to your desktop.

    3. Unblock the .bat file.

    4. Right click or press and hold on the .bat file, and click/tap on Run as administrator.

    5. If prompted by UAC, click/tap on Yes.

    6. A command prompt will now open to clear the event logs. The command prompt will automatically close when finished.





    OPTION TWO [/i] To Clear All Event Viewer Logs in Command Prompt
    1. Open an elevated command prompt.

    2. Copy and paste the command below into the elevated command prompt, and press Enter.

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

    3. The event logs will now be cleared. You can close the command prompt when it's finished.





    OPTION THREE [/i] To Clear All Event Viewer Logs in PowerShell
    1. Open an elevated Windows PowerShell.

    2. Copy and paste the command below you want to use into the elevated PowerShell, and press Enter.
    *Arrow Get-WinEvent -ListLog * | where {$_.RecordCount} | ForEach-Object -Process { [System.Diagnostics.Eventing.Reader.EventLogSession]::GlobalSession.ClearLog($_.LogName) }

    OR

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

    OR

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

    3. The event logs will now be cleared. You can close PowerShell when it's finished.





    OPTION FOUR [/i] To Clear Individual Event Viewer Logs in Event Viewer
    1. Press the Win + R keys to open the Run dialog, type eventvwr.msc, and click/tap on OK.

    2. Select a log (ex: Application) that you want to clear in the left pane of Event Viewer, and click/tap on Clear Log in the far right Actions pane. (see screenshot below)

    Clear All Event Logs in Event Viewer in Windows [​IMG]


    OR


    3. Right click or press and hold on a log (ex: Application) that you want to clear in the left pane of Event Viewer, and click/tap on Clear Log. (see screenshot below)

    Clear All Event Logs in Event Viewer in Windows [​IMG]

    4. Click/tap on Clear to confirm. (see screenshot below)

    Clear All Event Logs in Event Viewer in Windows [​IMG]


    That's it,
    Shawn


    Related Tutorials

    :)
     
    Joanne, Aug 15, 2015
    #1
  2. garybear89, Aug 15, 2015
    #2
  3. Delete Event Log Files created in one month

    Rishad,

    I noticed that some type of XML coding might help to export.

    I export the logs basically based on the setup of the events. For example, you have Event Viewer (Local) -> Windows Logs -> Security. And I export them to )say the month of April):

    D:\Logs\Event Viewer\Event Viewer (Local)\Windows Logs\2016\Security\

    D:\Logs\Event Viewer\Event Viewer (Local)\Windows Logs\2016\Security\Comma Separated Value - CSV\04.csv

    D:\Logs\Event Viewer\Event Viewer (Local)\Windows Logs\2016\Security\Event Viewer\No Display Information\04.evtx

    D:\Logs\Event Viewer\Event Viewer (Local)\Windows Logs\2016\Security\Event Viewer\Display Information for English\04..evtx

    D:\Logs\Event Viewer\Event Viewer (Local)\Windows Logs\2016\Security\Event Viewer Current View - XML\04.xml

    D:\Logs\Event Viewer\Event Viewer (Local)\Windows Logs\2016\Security\TXT\04.txt

    D:\Logs\Event Viewer\Event Viewer (Local)\Windows Logs\2016\Security\XML\No Display Information\04.xml

    D:\Logs\Event Viewer\Event Viewer (Local)\Windows Logs\2016\Security\XML\Display Information for English\04.xml

    What is getting a bit more difficult is creating the Event Viewer (Local) -> Applications and Services Logs -> Dell (OK a bit easy), but then you have Event Viewer (Local) -> Applications and Services Logs -> Microsoft -> Windows -> AAD. Which goes to:

    D:\Logs\Event Viewer\Event Viewer (Local)\Applications and Services Logs\Microsoft\Windows\AAD\Operational\2016\Comma Separated Files - CSV\01.csv

    D:\Logs\Event Viewer\Event Viewer (Local)\Applications and Services Logs\Microsoft\Windows\AAD\Operational\2016\Event Files\No Display Information\01.evtx

    D:\Logs\Event Viewer\Event Viewer (Local)\Applications and Services Logs\Microsoft\Windows\AAD\Operational\2016\Event Files\Display Information for English\01.evtx

    D:\Logs\Event Viewer\Event Viewer (Local)\Applications and Services Logs\Microsoft\Windows\AAD\Operational\2016\TXT\01.txt

    D:\Logs\Event Viewer\Event Viewer (Local)\Applications and Services Logs\Microsoft\Windows\AAD\Operational\2016\XML\No Display Information\01.xml

    D:\Logs\Event Viewer\Event Viewer (Local)\Applications and Services Logs\Microsoft\Windows\AAD\Operational\2016\XML\Display Information for English\01.xml

    So maybe if an XML export can some export / create the proper documents, that would be great!

    Thank you!
     
    CoreyBryant, Aug 15, 2015
    #3
  4. Cliff S New Member

    Clear All Event Logs in Event Viewer in Windows

    For Windows logs and Application and Services logs, there is also the manual way to clear specific logs(only these 2 sections, custom views can be Deleted and lost, but not Cleared for example:

    Clear All Event Logs in Event Viewer in Windows [​IMG]


    Clear All Event Logs in Event Viewer in Windows [​IMG]
     
    Cliff S, Aug 15, 2015
    #4
  5. Brink
    Brink New Member
    Hey Joanne,

    Yeah, I have no idea what "AirSpaceChannel" is for either.

    That would be normal in Powershell for any of the Analytic or Debug logs.
     
    Brink, Aug 15, 2015
    #5
  6. csmdew Win User
    Why is it that as the admin I still have to run the bat as admin for it to work; just wondering since on win 7 I just run it as is and it clears all logs. Tried this and would not clear without running using the "run as administrator". Thanks
     
    csmdew, Aug 30, 2015
    #6
  7. Brink
    Brink New Member
    Hello csmdew, and welcome to Ten Forums. *Smile

    It just needs to have elevated rights to be able to clear the event logs from the system.
     
    Brink, Aug 30, 2015
    #7
  8. windowsnt Win User

    Clear All Event Logs in Event Viewer in Windows

    It's Office 2016.

    Microsoft Office 2016 - AirSpaceChannel
    office 2016 airspacechannel - Google Search

    I know this is an older thread. Regardless, I wanted to post a note here just in case anyone else looks here as I did.

    Just FYI.
     
    windowsnt, Dec 10, 2015
    #8
  9. Brink
    Brink New Member
    Thank you windowsnt, and welcome to Ten Forums. *Smile
     
    Brink, Dec 10, 2015
    #9
  10. ddelo Win User
    Shawn, thanks a lot for the script.
    One more excellent job (like the life saver I just did with the Restore_Windows_Photo_Viewer one!!!).
    This one seems to be working perfectly, except from one thing, which I have highlighted in the picture.
    Do you have any idea what it is and how it can be fixed?


    Clear All Event Logs in Event Viewer in Windows [​IMG]


    BR. Dimitri
     
    ddelo, Jan 15, 2016
    #10
  11. Brink
    Brink New Member
    Brink, Jan 15, 2016
    #11
  12. ddelo Win User
    Nope..... same result in Safe Mode too!
     
    ddelo, Jan 15, 2016
    #12
  13. AnEdge Win User

    Clear All Event Logs in Event Viewer in Windows

    Thanks Brink, For years I used to do this manually and it always was a chore. This made my day!!
     
    AnEdge, Jan 15, 2016
    #13
  14. Brink
    Brink New Member
    It's basically saying that it cannot clear the "Application and Services Logs\Microsoft\RMS\MSIPC\Debug" log in Event Viewer while it's in use.

    Personally, it's nothing to worry about though.
     
    Brink, Jan 15, 2016
    #14
  15. Brink
    Brink New Member
    You're most welcome AnEdge. I'm glad it could help. *Smile
     
    Brink, Jan 15, 2016
    #15
Thema:

Clear All Event Logs in Event Viewer in Windows

Loading...
  1. Clear All Event Logs in Event Viewer in Windows - Similar Threads - Clear Event Logs

  2. Event viewer clear logs without administrator privileges

    in Windows 10 Gaming
    Event viewer clear logs without administrator privileges: Dear Microsoft Team,I have a windows 11 laptop. When I am logged with a non-admin user, I cannot clear logs. Is there a possibility to permit this non-admin user to clear logs in Event Viewer?Regards....
  3. Event viewer clear logs without administrator privileges

    in Windows 10 Software and Apps
    Event viewer clear logs without administrator privileges: Dear Microsoft Team,I have a windows 11 laptop. When I am logged with a non-admin user, I cannot clear logs. Is there a possibility to permit this non-admin user to clear logs in Event Viewer?Regards....
  4. WINDOWS updates-clears- all recent event viewer logs """" WHY """" ??? -

    in Windows 10 Installation and Upgrade
    WINDOWS updates-clears- all recent event viewer logs """" WHY """" ??? -: Recently I installed a few Windows Updates. IT CLEARED all prior Event Viewer Logs. WHY? I do not recall it doing this in past what gives? Why would this be beneficial to remove and or replace any or all prior events in Event Viewer? What purpose does this solve other...
  5. Event Viewer Log.

    in Windows 10 Ask Insider
    Event Viewer Log.: Need to create an event viewer log that tracks USB connects and disconnects. I have all my USB devices disconnecting and reconnecting. I need to identify if it's possibly my UPS (usb connected to PC), because it showed I had a battery discharge when i first installed my...
  6. Cannot clear Event Viewer logs with .ps1 script

    in Windows 10 Performance & Maintenance
    Cannot clear Event Viewer logs with .ps1 script: I created a PowerShell script saved as a .ps1 file, which is stated below. Whenever I run it, it says "Access is denied" and does not clean Event Viewer logs. Please take a look at the attached screenshots and let me know what I am doing wrong. By the way, whenever I run the...
  7. Cannot clear Event Viewer logs with .ps1 script

    in Windows 10 Support
    Cannot clear Event Viewer logs with .ps1 script: I created a PowerShell script saved as a .ps1 file, which is stated below. Whenever I run it, it says "Access is denied" and does not clean Event Viewer logs. Please take a look at the attached screenshots and let me know what I am doing wrong. By the way, whenever I run the...
  8. Event Viewer Logs

    in Windows 10 Support
    Event Viewer Logs: I’m currently on Win10 Pro x64, version 1709, Build 16299.371. Searching in my Event Viewer, I noticed some logs under the “Applications and Services Logs” folder, which I don’t recall having previously (pointed with red arrow, in the image) and are all inactive! Can...
  9. Clear Event Viewer Scheduler?

    in Windows 10 Support
    Clear Event Viewer Scheduler?: Could someone make the "Clear All Event Viewer Logs using a BAT file" self starting such as making it run automatically on a daily basis or show me what code I would need to add to it to do that for me. I would just love to clear out the 10016s and 7031s codes daily. Thanks...
  10. Clearing event viewer entries

    in Windows 10 Support
    Clearing event viewer entries: How can I construct a .bat file to clear entries in the event viewer. Thanks 12367