Skip to content

Instantly share code, notes, and snippets.

@jemekite
Created August 15, 2022 00:17
Show Gist options
  • Save jemekite/bdb3a7300870342018fba809f4f80931 to your computer and use it in GitHub Desktop.
Save jemekite/bdb3a7300870342018fba809f4f80931 to your computer and use it in GitHub Desktop.
Reset Reliability Monitor
:: Created by: Kapil Arya
:: Corresponding Article: http://www.thewindowsclub.com/
reg add "HKLM\SOFTWARE\Microsoft\Reliability Analysis\WMI" /v WMIEnable /T REG_DWORD /D 1 /F
del /f /S /Q /A "%ProgramData%\Microsoft\RAC\PublishedData\*"
del /f /S /Q /A "%ProgramData%\Microsoft\RAC\StateData\*"
@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 goto theEnd
:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
:noAdmin
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment