Event Viewer One Click Clear

Page 10 of 11 FirstFirst ... 891011 LastLast

  1. Posts : 6,458
    x64 (6.3.9600) Win8.1 Pro & soon dual boot x64 (6.1.7601) Win7_SP1 HomePrem
       #90

    Thanks Noel, just wanted to be sure Windows genuine wasn't messed up.

    sgmdew said:
    After running this test I tried sfc and it ran this time; it said there were no problems. Also tried to clear log files the cmd ran and event viewer said only 9 error events but when I opened the admin events log it showed 138 of them.
    Which test? PATH, Safe Mode, or New account?

    I'm going to suggest the PowerShell version again - it's much more simple. Basically the same function, but without all the cmds that might obscure the cause
    See: Event Viewer: Clear All Events
      My Computer


  2. Posts : 61
    Win 7 Pro 64 Bit
       #91

    Slartybart said:
    Thanks Noel, just wanted to be sure Windows genuine wasn't messed up.

    sgmdew said:
    After running this test I tried sfc and it ran this time; it said there were no problems. Also tried to clear log files the cmd ran and event viewer said only 9 error events but when I opened the admin events log it showed 138 of them.
    Which test? PATH, Safe Mode, or New account?

    I'm going to suggest the PowerShell version again - it's much more simple. Basically the same function, but without all the cmds that might obscure the cause
    See: Event Viewer: Clear All Events

    Foreach-Object not reconized as internal or external commands, etc
      My Computer


  3. Posts : 6,458
    x64 (6.3.9600) Win8.1 Pro & soon dual boot x64 (6.1.7601) Win7_SP1 HomePrem
       #92

    sgmdew,

    A member suggested that the issue might get better attention if you started a new thread outside of this tutorial. I agree since the issue isn't strictly related to the tutorial, but is more general in nature.

    I suggest your new thread be started in the General Discussion - Windows 7 Help Forums forum.
    There isn't a whole lot of information that would be lost, so please consider the above.

    Re: Foreach-Object not recognized as internal or external commands, etc
    I want to make sure that you opened an elevated PowerShell, not Command prompt, window. The Foreach-Object is a Powershell command is not recognized in a Command prompt.
    and a follow up - you had a similar issue with cmds, but I'm not certain how that was resolved. I made a few suggestions and your response was "After that test... it worked" I'm still not clear on what "test"

    It is imperative that members know what you've done, what suggestion proved helpful.

    So I'll ask one more time:
    sgmdew said:
    After running this test I tried sfc and it ran this time .....
    What test did you run that made SFC work for you?

    Let's continue reaching a resolution in your new thread, ok?

    Thanks,

    Bill
    .
      My Computer


  4. Posts : 6,458
    x64 (6.3.9600) Win8.1 Pro & soon dual boot x64 (6.1.7601) Win7_SP1 HomePrem
       #93

    sgmdew,

    Thanks for starting a new thread here.
    Clear Admin Log
      My Computer


  5. Posts : 1
    Windows 8.1 Pro
       #94

    Clear System Log Again - Cleanup


    After running the script, a few entries are added into the system event log that certain logs were cleared. This is due to the script clearing them alphabetically and several are cleared after the system event log. I wanted it to be super tidy so I added another line to clear the system event log one more time after everything else was cleared. Not sure if this is the best way to do it but thought I'd share my modification.

    I have also confirmed that this script works great on Windows 8.1 and Windows 2012 R2.

    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")
    wevtutil.exe cl System
    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
      My Computer


  6. Posts : 2
    Windows 7 Ultimate x64
       #95

    Hi Zardoc,

    Thanks for your sharing, but I have a question that how to clear the Windows log just the part of system, it's only need to clear the system log under Window logs. Thanks in advance!
      My Computer


  7. Posts : 72,046
    64-bit Windows 11 Pro for Workstations
       #96

    Hello Arvin, and welcome to Seven Forums.

    You could clear the "System" log under "Windows Logs" in Event Viewer by selecting System, then clicking on Clear log in the far right "Actions" pane like below. :)

    Event Viewer One Click Clear-system_log.jpg
      My Computer


  8. Posts : 2
    Windows 7 Ultimate x64
       #97

    Hi Brink,

    Thanks for your reply, if I'd like to clear the system log with one click completed, so how to do work using the bat command?
      My Computer


  9. Posts : 4
    Micro$oft 64-bit
       #98

    Here is my code for those wanting an even smaller batch file and quicker clean:

    Step 1: Copy/Paste the code into Notepad.
    Code:
    @echo off
    for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :clear "%%G")
    :clear
    echo clearing %1
    wevtutil.exe cl %1
    goto :eof
    exit
    Step 2: Save as "All Files" and make sure you have ".bat" at the end of the name.
    Step 3: Right click on the newly saved bat file, and click "Send to.. Desktop"
    Step 4: Right click on the newly made shortcut on the Desktop and click "Properties" then click "Advanced" then check the box "Run as Administrator" and hit "OK"

    Now you can simply double click the shortcut at your leisure and quickly clear event logs. No annoying Yes|No prompts to clear logs and no "click to exit prompt" pauses after clearing and all done with 141 bytes of code.
      My Computer


  10. Posts : 61
    Win 7 Pro 64 Bit
       #99

    Thanks, works great win 7Pro, 64bit
      My Computer


 
Page 10 of 11 FirstFirst ... 891011 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 16:57.
Find Us