Jump to content

Clearing the *Event Viewer Logs*


pc71520

Recommended Posts

The Event Viewer can be found in Control Panel\All Control Panel Items\Administrative Tools

x7lmwtyi1hs4iwj9lse9s_s.jpg

xpn67msfwexnug3x8ax_s.jpg

Following, it is the content of a batch file that Clears the Event Viewer

:: Set console.
:: /************************************************************************************/
:mode
echo off
mode con cols=78 lines=30
color 17
cls
@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 All Event Logs have been cleared!
goto theEnd
:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
:noAdmin
echo Current user permissions to execute this .BAT file are inadequate.
echo This .BAT file must be run with administrative privileges.
echo Exit now, right click on this .BAT file, and select "Run as administrator".  
pause >nul
:theEnd

1) Copy the above.

2) Open Notepad.

3) Paste what you Copied.

4) Save as Clear Event Viewer Logs.

 

1) Running the Clear Event Viewer Logs.cmd file with Administrative Privileges  (i.e. Right-click on it and select "Run as administrator")

and

2) Rebooting your system

will result in a clean Event Viewer.

Link to comment
Share on other sites


  • Replies 7
  • Views 795
  • Created
  • Last Reply

any way how to check when was your last time pc was booted.. like in my absence do someone booted the pc

Link to comment
Share on other sites


Is it mandatory to reboot after these commands?

Tried in a VM (w7 x64) and the event viewer logs seemed empty right after running your .cmd file.

Link to comment
Share on other sites


14 hours ago, mp68terr said:

Is it mandatory to reboot after these commands?

Tried in a VM (w7 x64) and the event viewer logs seemed empty right after running your .cmd file.

Then, you know. ;)

Link to comment
Share on other sites


12 hours ago, teodz1984 said:

ccleaner takes a while to load esp with winapp lists.. 

Try winapp2ool by 

https://github.com/MoscaDotTo/Winapp2/raw/master/winapp2ool/bin/Release/winapp2ool.exe

 

Link to comment
Share on other sites


Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...