Event Viewer One Click Clear

Page 5 of 11 FirstFirst ... 34567 ... LastLast

  1. Posts : 557
    Windows 7 x64 Ultimate SP1
    Thread Starter
       #40

    devnulllore said:
    @Lightningltd

    Great batch file! but I have always wondered, what's with the long pauses between various log clearings?

    dev
    Slow processor reaction. Mine slides like butter.

      My Computer


  2. Posts : 23
    Win7 x64
       #41

    I have 3 edits of this file, which one is the best?

    @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 Event Logs have been cleared! ^<press any key^>
    goto theEnd
    :do_clear
    echo clearing %1
    wevtutil.exe cl %1
    goto :eof
    :noAdmin
    echo You must run this script as an Administrator!
    echo ^<press any key^>
    :theEnd
    pause>NUL

    --------------------------------------------------------------------------------------------

    @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 goto theEnd
    :do_clear
    echo clearing %1
    wevtutil.exe cl %1
    goto :eof
    :noAdmin
    exit

    ---------------------------------------------------------------------------------------------

    @echo off
    FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V
    IF (%adminTest%)==(Access) goto theEnd
    for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
    goto theEnd
    :do_clear
    echo clearing %1
    wevtutil.exe cl %1
    goto :eof
    :theEnd


    They all appear to do the same thing, but is any one of them "better" than the others?
      My Computer


  3. Posts : 557
    Windows 7 x64 Ultimate SP1
    Thread Starter
       #42

    Hi there,

    The last one is the best. It has all unecessary commands removed.


    @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 goto theEnd
    :do_clear
    echo clearing %1
    wevtutil.exe cl %1
    goto :eof
    :noAdmin
    exit

      My Computer


  4. Posts : 23
    Win7 x64
       #43

    Zardoc said:
    Hi there,

    The last one is the best. It has all unecessary commands removed.


    @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 goto theEnd
    :do_clear
    echo clearing %1
    wevtutil.exe cl %1
    goto :eof
    :noAdmin
    exit


    You say the last one but you show the second one in your post???
      My Computer


  5. Posts : 557
    Windows 7 x64 Ultimate SP1
    Thread Starter
       #44

    My Bad, second one.

    Sorry
      My Computer


  6. Posts : 150
    windows 7 home premium 64bit
       #45

    Thanks a lot.
      My Computer


  7. Posts : 557
    Windows 7 x64 Ultimate SP1
    Thread Starter
       #46

    Hi barbarossa2241,

    You're welcome.
      My Computer


  8. Posts : 14
    win7 Ultimate 64
       #47

    Nice Gift Thanks
      My Computer


  9. Posts : 557
    Windows 7 x64 Ultimate SP1
    Thread Starter
       #48

    Hi Korea7 ,

    You're welcome.
      My Computer


  10. Posts : 1
    Windows 7 Home Premium 64 bit
       #49

    I had so many errors and warning - this cleared them out...thanks a billion. Looking forward to browsing these forums for more info in the future!
      My Computer


 
Page 5 of 11 FirstFirst ... 34567 ... LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:50.
Find Us