Event View Cleaner Will Not Work-Help!


  1. Posts : 63
    Win 10 Pro
       #1

    Event View Cleaner Will Not Work-Help!


    I downloaded this bat file in Option 1 of the below link off this forum.
    Clear All Event Logs in Event Viewer in Windows

    and when I run it you can see as the screen scrolls down that it says that the log entry failed to clean.

    Event View Cleaner Will Not Work-Help!-evc.jpg

    In this link it shows how to unblock a file from running.
    Unblock File in Windows 10

    Well the bat file runs fine, it is just not cleaning out the logs in Event Viewer. After the bat file runs Event Viewer "Summary of Admin Events" all five categories are still full of events from the day the laptop was first turned on, nothing has been deleted.

    I even tried this Powershell option and this also did not delete anything.
    https://superuser.com/questions/1073...g-in-windows10

    Any ideas why the bat file runs, but does not delete anything?
      My Computer


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

    Hello idahosurge, and welcome to Ten Forums. :)

    It looks like you may not have right clicked on the .bat file, and clicked on "Run as administrator" to run the .bat file with elevated rights.
      My Computers


  3. WOT
    Posts : 471
    Win 10 Pro 15063.332 (ex-Insider)
       #3

    @Brink:
    Would it be possible to modify the .BAT file to give instructions when someone tries to run it by just clicking?

    Here is a .BAT file (I modified) that gives instructions when clicked but executes OK when run as admin:
    Code:
    @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 this .BAT file, and select Run as Administrator.  
    pause >nul
    :theEnd

    Here is the result when I just clicked on the above .BAT file:
    Event View Cleaner Will Not Work-Help!-admin.jpg

    For your consideration.

    Regards,

    WOT
      My Computers


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

    Thank you @WOT. I have updated the .bat file for this in the tutorial. :)
      My Computers


  5. WOT
    Posts : 471
    Win 10 Pro 15063.332 (ex-Insider)
       #5

    Brink said:
    Thank you @WOT. I have updated the .bat file for this in the tutorial. :)
    Thank you for your review and consideration.

    Regards,

    WOT
      My Computers


  6. Posts : 63
    Win 10 Pro
    Thread Starter
       #6

    Thanks to both of you.

    Running as Admin worked!
      My Computer


  7. Posts : 68,954
    64-bit Windows 11 Pro for Workstations
       #7

    Great news. I'm glad we could help. :)
      My Computers


  8. WOT
    Posts : 471
    Win 10 Pro 15063.332 (ex-Insider)
       #8

    One can also create a shortcut to this .bat file and tick "run as admin" to ensure it will run without notice:

    Event View Cleaner Will Not Work-Help!-screenshot-5-.png
      My Computers


 

  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 04:25.
Find Us




Windows 10 Forums