1.    13 May 2017 #1
    Join Date : May 2017
    Posts : 11
    Win 10 Pro

    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.

    Click image for larger version. 

Name:	EVC.jpg 
Views:	4 
Size:	815.1 KB 
ID:	134817

    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 ComputerSystem Spec
  2.    13 May 2017 #2
    Join Date : Oct 2013
    Posts : 25,174
    64-bit Windows 10 Pro build 17040

    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 ComputersSystem Spec
  3.    13 May 2017 #3
    Join Date : Mar 2017
    Posts : 471
    Win 10 Pro 15063.332 (ex-Insider)

    @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:
    Click image for larger version. 

Name:	admin.jpg 
Views:	32 
Size:	20.5 KB 
ID:	134839

    For your consideration.

    Regards,

    WOT
      My ComputersSystem Spec
  4.    13 May 2017 #4
    Join Date : Oct 2013
    Posts : 25,174
    64-bit Windows 10 Pro build 17040

    Thank you @WOT. I have updated the .bat file for this in the tutorial.
      My ComputersSystem Spec
  5.    13 May 2017 #5
    Join Date : Mar 2017
    Posts : 471
    Win 10 Pro 15063.332 (ex-Insider)

    Quote Originally Posted by Brink View Post
    Thank you @WOT. I have updated the .bat file for this in the tutorial.
    Thank you for your review and consideration.

    Regards,

    WOT
      My ComputersSystem Spec
  6.    13 May 2017 #6
    Join Date : May 2017
    Posts : 11
    Win 10 Pro
    Thread Starter

    Thanks to both of you.

    Running as Admin worked!
      My ComputerSystem Spec
  7.    13 May 2017 #7
    Join Date : Oct 2013
    Posts : 25,174
    64-bit Windows 10 Pro build 17040

    Great news. I'm glad we could help.
      My ComputersSystem Spec
  8.    15 May 2017 #8
    Join Date : Mar 2017
    Posts : 471
    Win 10 Pro 15063.332 (ex-Insider)

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

    Click image for larger version. 

Name:	Screenshot (5).png 
Views:	5 
Size:	89.5 KB 
ID:	135090
      My ComputersSystem Spec

 


Similar Threads
Thread Forum
error is showing up in the Event View System Log
Since updating to KB3176938 the following error is showing up in the Event View System Log: The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID...
General Support
What disk cleaner/registry cleaner are you using
Win 10 til July I did way to much testing, trial and error on various tools, apps, utilities, etc. I'm afraid of most website reviews because of malware and false positive reviews because of affiliation. Is there something else great like CCleaner...
Performance & Maintenance
What is the source of Printer Status Events in Windows 10? Event View
While looking at Event Viewer, if I send a file to Print, I can see various entries in the logs regarding spooling and cancelled jobs - all located in: Microsoft->Windows->PrintSystems But if I send a print job to an offline printer or if there is...
General Support
Windows cleaner, registry cleaner recomendations PLEASE!
I have used Ccleaner and REVO to clean and maintain my Windows environment. So I am looking for your thoughts and comments as to what you recommend for cleaning Windows and Windows registry. And if you could add why I would really appreciate it....
Performance & Maintenance
EDGE - cleaner reading doesn't work
Hi there How do you enable the "Cleaner Reading" panel. Mine just shows a blue area and stops. Using Insider build 10532 W10 Pro edition X64 36414 Cheers jimbo
Browsers and Email
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 05:29.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums