image
AnonymJun 27, 2013

Batch Script for cleaning the Event Viewer logs in Win 7?

1
0+
0-
Visible
  • Best answer

  • Others answers (2)

  • image
    Jun 27, 2013

    Want to clean out your Event Viewer logs ? Here is the script: Code: [Select] @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 Open Notepad and copy/paste the above script into it and save it as a *.bat file extension. When you want to run it, right click on the *.bat file and select Run as administrator. That's it, the event viewer logs are now empty.

    0+
    0-
    Comment
  • image
    Jun 27, 2013

    If you want to clear the windows log file in your windows 7,8 or Vista then use this batch script to clear it. Copy and paste this script in a notepad and save it with an extension .bat. And then run that file "As administrator". @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") /bu: echo. echo goto theEnd :do_clear echo clearing %1 wevtutil.exe cl Application /bu:C:\EventViewerBackups\Applicationbackup.evtx %1 goto :eof :noAdmin exit

    0+
    0-
    Comment
  • image