• Hi there and welcome to PC Help Forum (PCHF), a more effective way to get the Tech Support you need!
    We have Experts in all areas of Tech, including Malware Removal, Crash Fixing and BSOD's , Microsoft Windows, Computer DIY and PC Hardware, Networking, Gaming, Tablets and iPads, General and Specific Software Support and so much more.

    Why not Click Here To Sign Up and start enjoying great FREE Tech Support.

    This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Delete Logs From Event Viewer?

Status
Not open for further replies.
Please copy and paste below batch script codes to notepad and save it as ClearEventLogs.bat

Code:
:: Created by FreeBooter

@Echo Off & Cls
Call :NoAdmin
Mode CON  LINES=33 COLS=85
For /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
Echo.
Echo                    Event Logs Have Been Cleared!
Ping -n 5 127.0.0.1 >Nul
Goto :eof
:do_clear
Echo clearing %1
wevtutil.exe cl %1
Goto :eof

:NoAdmin
Reg query "HKU\S-1-5-19\Environment"
If Not %ERRORLEVEL% EQU 0 (
 Cls & Mode CON  LINES=5 COLS=48 & Color 0C &  Title  .....................- WARNING -.......................
 Echo.
 Echo.
 Echo  YOU MUST HAVE ADMINISTRATOR RIGHTS TO CONTINUE
 Pause >Nul & Exit
)
 Cls
 Goto :eof
 
Status
Not open for further replies.