Skip to content

Instantly share code, notes, and snippets.

@jessefmoore
Created October 8, 2022 16:13
Show Gist options
  • Save jessefmoore/5a0a8703983e0a48ae73efc11f26c3e8 to your computer and use it in GitHub Desktop.
Save jessefmoore/5a0a8703983e0a48ae73efc11f26c3e8 to your computer and use it in GitHub Desktop.
#Dfir-jesseee modified
# 10/08/2022
# in use at CyberForce and CCDC
#
@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 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
@jessefmoore
Copy link
Author

made public to choco it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment