Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Polished (Event) Log Cleaning Script


06 Jul 2011   #1

Windows 7 Professional x64 SP1
 
 
(Event) Log Cleaning Script

This clears every log registered with event viewer. It will leave only one entry when done; "The System log file was cleared."

http://forums.windowsforum.org/index...howtopic=46107 - Original Script
Code:
@echo off
TITLE Eventing Command Line Utility: Cleanup Script
goto :question

:question
echo.
echo EMPTY ALL WINDOWS AND PROGRAM EVENT LOGS?
echo.
SET /P ANSWER=(YES/NO): 
if /i {"%ANSWER%"}=={"y"}   (goto :start)
if /i {"%ANSWER%"}=={"yes"} (goto :start)
if /i {"%ANSWER%"}=={"n"}   (goto :cancel)
if /i {"%ANSWER%"}=={"no"}  (goto :cancel)
goto :input_error

:input_error
cls
echo.
echo          *ERROR: Invalid Option
echo _________________________________________
goto :question

:start
for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :clear "%%G")
goto :finish

:clear
echo Emptying %1
wevtutil.exe cl %1
goto :eof

:finish
cls
echo.
wevtutil.exe cl System
echo.
echo DONE. Press any key to exit.
pause>NUL
goto :eof

:cancel
cls
echo.
echo USER CANCELED, Quiting Silently...
goto :eof

::eof
Save this as LogClear.cmd in C:\Windows and create a shortcut to launch it as a Administrator -



My System SpecsSystem Spec
.

Reply

 Polished (Event) Log Cleaning Script




Thread Tools




Our Sites

Site Links

About Us

Find 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 06:16 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33