Failed to clear event logs


  1. Posts : 3
    Windows 7 Ultimate and Windows 10 Home
       #1

    Failed to clear event logs


    Hi @Brink, hope you are around for this! LOL
    This has not occurred between October 16, 2016, when I purchased this it, and today.
    So, if it is a minor issue, I am OK with ignoring these results.

    Failed to clear event logs

    Failed to clear event logs using Clear_Event_Viewer_Logs.bat, which I downloaded yesterday.
    Please note the three logs just below:

    clearing "Microsoft-Windows-LiveId/Analytic"
    Failed to clear log Microsoft-Windows-LiveId/Analytic.
    Access is denied.

    clearing "Microsoft-Windows-LiveId/Operational"
    Failed to clear log Microsoft-Windows-LiveId/Operational.
    Access is denied.

    clearing "Microsoft-Windows-USBVideo/Analytic"
    Failed to clear log Microsoft-Windows-USBVideo/Analytic.
    The instance name passed was not recognized as valid
    by a WMI data provider.

    ===============================================================

    Clear_Event_Viewer_Logs.bat

    :: Created by: Shawn Brink
    :: Created on: August 15th 2016
    :: Updated on: May 13th 2017
    :: Tutorial: Clear All Event Logs in Event Viewer in Windows Performance Maintenance Tutorials


    @echo off

    FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V
    IF (%adminTest%)==(Access) goto noAdmin
    for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
    echo.
    echo All Event Logs have been cleared!
    goto theEnd

    :do_clear
    echo clearing %1
    wevtutil.exe cl %1
    goto :eof

    :noAdmin
    echo Current user permissions to execute this .BAT file are inadequate.
    echo This .BAT file must be run with administrative privileges.
    echo Exit now, right click on this .BAT file, and select "Run as administrator".
    pause >nul

    :theEnd
    =============================================================================

    psjimm
    "No one can help everyone but everyone can help someone"
    Ronald Reagan

    p.s.
    I activated the build-in Administrator account, same results.
    At first I had used the Win 7 Clear Viewer V2.bat which I had downloaded from Seven Forums on June 16, 2015

    Dell Inspiron 570
    64-Bit
    Windows 10 Pro
    See Attached CPU-ID Report on my Dell Inspiron 570
    Failed to clear event logs Attached Files
    Last edited by Barman58; 17 Dec 2017 at 14:00.
      My Computer


  2. Posts : 68,918
    64-bit Windows 11 Pro for Workstations
       #2

    Hello Jim, and welcome to Ten Forums. :)

    Just to verify, did you right click on the .bat file and click on "Run as administrator"?
      My Computers


  3. Posts : 3
    Windows 7 Ultimate and Windows 10 Home
    Thread Starter
       #3

    Brink asked
    "Just to verify, did you right click on the .bat file and click on "Run as administrator"?

    Yes, I did and I was in the hidden Admin account, bat not blocked.
    My apologies for the delay responding!
    Ran it on a Win 7 and a Win 10 machine
      My Computer


  4. Posts : 68,918
    64-bit Windows 11 Pro for Workstations
       #4

    No problem Jim. :)

    It's not unusual for some of the event logs to not get cleared. I got "Access is denied" for the eact same ones you did. This can happen if they're in use or protected by the system.
      My Computers


  5. Posts : 1
    Windows10
       #5

    To clear Microsoft-Windows-LiveId/Operational and Analytic logs Win10


    Open command Prompt (as Administrator) and type the following lines:

    type in the following line and hit the ENTER key:

    wevtutil sl Microsoft-Windows-LiveId/Operational /ca:O:BAG:SYD:(A;;0x1;;;SY)(A;;0x5;;;BA)(A;;0x1;;;LA)

    Then type in the following line and hit the ENTER key:

    wevtutil sl Microsoft-Windows-LiveId/Analytic /ca:O:BAG:SYD:(A;;0x1;;;SY)(A;;0x5;;;BA)(A;;0x1;;;LA)

    Works for me on windows2019 LTSC

    Bye for now.
      My Computer


  6. Posts : 5,452
    Windows 11 Home
       #6

    You can always use the brute force, just stop Event Log service temporarily and kaboom.
    Code:
    net stop EventLog /y
    del "%ProgramData%\USOShared\Logs" /s /f /q
    del "%WINDIR%\Logs" /s /f /q
    del "%WINDIR%\System32\LogFiles" /s /f /q
    del "%WINDIR%\System32\winevt\Logs" /s /f /q
      My Computer


 

  Related Discussions
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 07:55.
Find Us




Windows 10 Forums