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

Page 4 of 4 FirstFirst ... 234

  1. Posts : 240
    Windows 10 1703 Build 15063
       17 Aug 2016 #30

    FWIW CCleaner will clear the Event Viewer Logs - just check the box under Windows>Advanced>Windows Events Logs. run CCleaner and it's that simple. Much faster than most ,bat files I've tried. Just a suggestion.
      My ComputerSystem Spec


  2. Posts : 522
    Windows 10 Pro 64bit; Windows 10 TP; KDE Neon
       17 Aug 2016 #31

    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:

    Click image for larger version. 

Name:	e.PNG 
Views:	78 
Size:	21.7 KB 
ID:	96683


    Right after rebooting one time:

    Click image for larger version. 

Name:	e1.PNG 
Views:	87 
Size:	23.2 KB 
ID:	96684



    CCleaner Pro manages to reset my Reliability History, though, something I deeply appreciate!
      My ComputerSystem Spec


  3. Posts : 240
    Windows 10 1703 Build 15063
       19 Aug 2016 #32

    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?
      My ComputerSystem Spec


  4. Posts : 22,861
    64-bit Windows 10 Pro build 16257
    Thread Starter
       19 Aug 2016 #33

    Hello John,

    It can vary per system, but it could take a while if the PC is having issues or a large amount of events.
      My ComputersSystem Spec

  5.    30 Sep 2016 #34

    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?
      My ComputerSystem Spec


  6. Posts : 100
    Microsoft Windows 10 x64
       11 Nov 2016 #35

    Excellent, it saves me a lot of time
    thank you

    Maybe "pure" Powershell syntax is

    Get-EventLog -LogName * | ForEach { Clear-EventLog $_.Log }
      My ComputerSystem Spec


  7. Posts : 22,861
    64-bit Windows 10 Pro build 16257
    Thread Starter
       11 Nov 2016 #36

    D4ni3l said: View Post
    Excellent, it saves me a lot of time
    thank you

    Maybe "pure" Powershell syntax is

    Get-EventLog -LogName * | ForEach { Clear-EventLog $_.Log }
    Thank you. Added.
      My ComputersSystem Spec

  8.    3 Weeks Ago #37

    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:

    @echo off

    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
      My ComputerSystem Spec


  9. Posts : 22,861
    64-bit Windows 10 Pro build 16257
    Thread Starter
       3 Weeks Ago #38

    Hello pureocean,

    Did you use Option Two in an elevated command prompt?
      My ComputersSystem Spec

  10.    3 Weeks Ago #39

    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
      My ComputerSystem Spec


 
Page 4 of 4 FirstFirst ... 234

Related Threads
Event Viewer -- Audit Failure 5061 in Performance & Maintenance
I continue to get this event in the Event Log under Audit Failure. I never had in Windows 8.1 and it started after upgrading to 10. Does anyone have a clue about it? Cryptographic operation. Subject: Security ID: SYSTEM Account...
Worried about event viewer errors in Performance & Maintenance
hi guys managed to install windows 10 and everything seems to be working great. I looked in event viewer and I'm getting loads of errors, the same over and over. one is that keeps coming up is kernel-power event id 137 The system...
Clearing event viewer entries in General Support
How can I construct a .bat file to clear entries in the event viewer. Thanks
TONS of errors in event viewer in Performance & Maintenance
I just clean installed my windows, and have not made any changes as to what would cause these errors.... but in event viewer, since install on the 29th, i have 800 errors and warnings. ive noticed on my other PC that i just installed 10 on...
I'm getting certain repeating errors in Event Viewer when I reboot my new Win Pro 64-bit (after yesterday's upgrade from Win 8.1 Pro 64-bit). Please see the details and post your thoughts here: ...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 12:03.
Find Us