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; The only way to bring my Event Viewer to its purest state is the second option of this tutorial. CCleaner Pro does not clean it as thoroughly. Right... Discussion in 'Windows 10 Tutorials' started by Joanne, Aug 15, 2015.

  1. Joanne Win User

    Clear All Event Logs in Event Viewer in Windows


    The only way to bring my Event Viewer to its purest state is the second option of this tutorial. CCleaner Pro does not clean it as thoroughly.

    Right after cleaning, before rebooting:


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



    Right after rebooting one time:


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




    CCleaner Pro manages to reset my Reliability History, though, something I deeply appreciate! *Smile
     
    Joanne, Aug 16, 2016
    #31
  2. JohnBurns Win User

    When using the batch file in Option 1, the process runs very fast in one pc , but very slow in the other. Previously, both ran very fast. What setting could I have messed up to slow down the speed of the batch file?
     
    JohnBurns, Aug 19, 2016
    #32
  3. Brink
    Brink New Member
    Hello John, *Smile

    It can vary per system, but it could take a while if the PC is having issues or a large amount of events.
     
    Brink, Aug 19, 2016
    #33
  4. Clear All Event Logs in Event Viewer in Windows

    Is there any way to clear all OLD events from all event logs? I would like to clear everything more than (for example) 1 month old. Doable?
     
    AWastedSaturday, Sep 29, 2016
    #34
  5. D4ni3l Win User
    Excellent, it saves me a lot of time
    thank you

    Maybe "pure" Powershell syntax is

    Get-EventLog -LogName * | ForEach { Clear-EventLog $_.Log }
     
    D4ni3l, Nov 10, 2016
    #35
  6. Brink
    Brink New Member
    Thank you. Added. *Smile
     
    Brink, Nov 10, 2016
    #36
  7. pureocean Win User
    Knowns methods can't clean my Microsoft-Windows-LiveId (and one or two log).
    Need to be manually all delete files in %windir%\System32\winevt\Logs\*.*
    I tried this commands as BAT file:

     
    pureocean, Jul 23, 2017
    #37
  8. Brink
    Brink New Member

    Clear All Event Logs in Event Viewer in Windows

    Hello pureocean, *Smile

    Did you use Option Two in an elevated command prompt?
     
    Brink, Jul 23, 2017
    #38
  9. I made a few modifications to pureocean's batch file to solve the required elevation and added a section to create a backup of the log files that are about to be deleted. It appears to work as it should.
    I included it below if anyone else wants it. The "batgotadmin" section is pretty widely used for this and always seems to work for me.

    Code: @echo off REM --> Check for permissions >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" REM --> If error flag set, we do not have admin. if '%errorlevel%' NEQ '0' ( echo Requesting administrative privileges... goto UACPrompt ) else ( goto gotAdmin ) :UACPrompt echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs" "%temp%\getadmin.vbs" exit /B :gotAdmin if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" ) pushd "%CD%" CD /D "%~dp0" REM --> Create backup folder using date-time and copy all logs to folder. for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set datetime=%%I md c:\%datetime%-logs copy %windir%\System32\winevt\Logs\*.* c:\%datetime%-logs net stop NcdAutoSetup net stop netprofm net stop NlaSvc net stop EventLog ping 1.1.1.1 -n 1 -w 1500 > nul del /f /q /a %windir%\System32\winevt\Logs\*.* > nul for /f %%a in ('WEVTUTIL EL') do WEVTUTIL CL "%%a" > nul net start NcdAutoSetup net start netprofm net start NlaSvc net start EventLog[/quote]
     
    questorfla, Jul 26, 2017
    #39
  10. dgwin10 Win User
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