Skip to content

Instantly share code, notes, and snippets.

@Saltinbank-SyS
Last active August 14, 2024 16:02
Show Gist options
  • Save Saltinbank-SyS/3c59abd6583e04172972242d94f5bb6d to your computer and use it in GitHub Desktop.
Save Saltinbank-SyS/3c59abd6583e04172972242d94f5bb6d to your computer and use it in GitHub Desktop.
EVENT LOGS in HEAVEN // BATCH FILE - Les journaux d'événements au Paradis ...
@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 are now in Heaven .. // Event Logs sont au Paradis! <Press any Key ^^ // Pressez une Touche ^^>
goto theEnd
:do_clear
echo effacement %1
wevtutil.exe cl %1
goto :eof
:noAdmin
echo You must run this script as an Admin!
echo ^Press any Key // Presse une Touche^>
:theEnd
pause>NUL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment