1) Create a batch file (.bat extention) with below code and run as Administrator.
@echo off
echo Temp files deletion Started!!
cd %temp%
DEL *.*
echo Temp files deletion Completed!!
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! ^
goto theEnd
:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
:noAdmin
echo You must run this script as an Administrator!
echo ^
:theEnd
pause>NUL
2) Run atleast once in a month time to clean temp files and windows logs.
No comments:
Post a Comment