How to Clear Vista event viewer logs?

Discussion in 'other software & services' started by korben, Jan 26, 2010.

Thread Status:
Not open for further replies.
  1. korben

    korben Registered Member

    Joined:
    Nov 5, 2009
    Posts:
    917
    Been wondering and even tried to find out on my own but failed.

    any suggestions how to achieve the goal in question?
     
  2. ronjor

    ronjor Global Moderator

    Joined:
    Jul 21, 2003
    Posts:
    164,145
    Location:
    Texas
  3. korben

    korben Registered Member

    Joined:
    Nov 5, 2009
    Posts:
    917
    If only it was so easy..

    stuck on no 3

    No such thing in my action menu
     
  4. ronjor

    ronjor Global Moderator

    Joined:
    Jul 21, 2003
    Posts:
    164,145
    Location:
    Texas
  5. Seer

    Seer Registered Member

    Joined:
    Feb 12, 2007
    Posts:
    2,068
    Location:
    Serbia
    Context menu -

    Untitled.png
     
  6. Franklin

    Franklin Registered Member

    Joined:
    May 12, 2005
    Posts:
    2,517
    Location:
    West Aussie
    Going on Ronjor's first link I right clicked on desktop - New - Shortcut and entered the below and named them appropriately. No quotes.

    " wevtutil cl System " clears system logs....

    " wevtutil cl Application "

    " wevtutil cl Security "

    This seemed to work fine on Vista and 7.

    On a Vista VM I copied and pasted the shortcuts to the users Startup folder and it seemed to work as well in the logs being cleared at startup.
     
  7. korben

    korben Registered Member

    Joined:
    Nov 5, 2009
    Posts:
    917
    Gentlemen - hats off....

    I knew it was somewhere well hidden and used to have a chance to use it but it was 14 months ago and now my friend's Vista was crying for this procedure to make things clear cut and... simple.

    thanks again
     
  8. stackz

    stackz Registered Member

    Joined:
    Dec 27, 2007
    Posts:
    646
    Location:
    Sydney Australia
    I use this for Win 7 x64
    Code:
    @echo off
    for /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V
    if (%adminTest%)==(Access) goto noAdmin
    echo Clearing all Eventlogs 
    echo Please Wait...
    for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
    echo.
    echo Event Logs have been cleared!
    goto theEnd
    :do_clear
    ::echo clearing %1
    wevtutil.exe cl %1
    goto :eof
    
    :noAdmin
    echo You must run this script as an Administrator!
    
    :theEnd
    echo.
    echo Press any key to exit
    pause>nul 
    
    Save as something like ClsEventLogs.bat
     
  9. korben

    korben Registered Member

    Joined:
    Nov 5, 2009
    Posts:
    917
    thank you as well

    I needed this for her vista machine...

    on my win 7 I use this:
    h t t p://www.sevenforums.com/attachments/tutorials/31842d1255852144-event-viewer-one-click-clear-win-7-clear-viewer.zip
     
  10. Franklin

    Franklin Registered Member

    Joined:
    May 12, 2005
    Posts:
    2,517
    Location:
    West Aussie
    Also got the below .bat from Win 7 Forums.

    Is the "backup" log needed if booting from a Vista or 7 dvd to do a restore from a saved image?
    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 goto theEnd
    :do_clear
    echo clearing %1
    wevtutil.exe cl %1
    goto :eof
    :noAdmin
    exit
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.