[Answered] Event viewer

Discussion in 'Scripting' started by zors1986, Mar 18, 2025.

  1. zors1986

    zors1986 MDL Novice

    Apr 15, 2019
    2
    1
    0
    Hello, i want create a script that remove specific event from event viewer. Do you know how can i do that?
     
  2. Javac75

    Javac75 MDL Member

    Mar 16, 2015
    237
    321
    10
    Collect the events into one file (ex. eventslog.txt)
    Code:
    For /f "tokens=*" %%# in ('Findstr /i . eventslog.txt') do (call :disEventsLog %%#)
    
    :disEventsLog
    for /f "tokens=*" %%a in ('Reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\%~1" /v "Enabled" 2^>Nul ^| find /i "REG_DWORD"') do (
    Reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\%~1" /f /v "Enabled" /t REG_DWORD /d "0"
    )
    exit /b
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. zors1986

    zors1986 MDL Novice

    Apr 15, 2019
    2
    1
    0
    Thanks a lot