4 Replies Latest reply on Sep 15, 2018 11:41 PM by elstaci

    FYI: How to delete all Event Viewer logs using Powershell command

    elstaci

      Up to now I have been using a Batch file that someone created for Windows 7, in the past, to clear all Windows 10 Event Viewer logs at one time. But now found the following Powershell command that does the same function.

       

      The Powershell Command is: (just copy and paste to Powershell)

       

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

       

      This clears all the logs in Event Viewer.

       

      I sometimes like to clear all the logs of Event Viewer after troubleshooting Windows for Event Viewer type errors. This allows me to see clearly all the errors that occurs after applying the fix to whatever problem I had instead of seeing a huge amount of past errors.

       

      EDIT: goodplay found a Forum where you can download a .BAT file to delete all the Event Viewer logs. The link is in his comment.

       

      But if you don't feel comfortable using a .bat file then use the above Powershell command which is the safest way of deleting all Event Viewer logs at one time.