Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Event Viewer One Click Clear

23 May 2014   #90
Slartybart

x64 (6.3.9600) Win8.1 Pro & soon dual boot x64 (6.1.7601) Win7_SP1 HomePrem
 
 

Thanks Noel, just wanted to be sure Windows genuine wasn't messed up.

Quote   Quote: Originally Posted by sgmdew View Post
After running this test I tried sfc and it ran this time; it said there were no problems. Also tried to clear log files the cmd ran and event viewer said only 9 error events but when I opened the admin events log it showed 138 of them.
Which test? PATH, Safe Mode, or New account?

I'm going to suggest the PowerShell version again - it's much more simple. Basically the same function, but without all the cmds that might obscure the cause
See: Event Viewer: Clear All Events


My System SpecsSystem Spec
.
23 May 2014   #91
sgmdew

Win 7 Pro 64 Bit
 
 

Quote   Quote: Originally Posted by Slartybart View Post
Thanks Noel, just wanted to be sure Windows genuine wasn't messed up.

Quote   Quote: Originally Posted by sgmdew View Post
After running this test I tried sfc and it ran this time; it said there were no problems. Also tried to clear log files the cmd ran and event viewer said only 9 error events but when I opened the admin events log it showed 138 of them.
Which test? PATH, Safe Mode, or New account?

I'm going to suggest the PowerShell version again - it's much more simple. Basically the same function, but without all the cmds that might obscure the cause
See: Event Viewer: Clear All Events

Foreach-Object not reconized as internal or external commands, etc
My System SpecsSystem Spec
23 May 2014   #92
Slartybart

x64 (6.3.9600) Win8.1 Pro & soon dual boot x64 (6.1.7601) Win7_SP1 HomePrem
 
 

sgmdew,

A member suggested that the issue might get better attention if you started a new thread outside of this tutorial. I agree since the issue isn't strictly related to the tutorial, but is more general in nature.

I suggest your new thread be started in the General Discussion - Windows 7 Help Forums forum.
There isn't a whole lot of information that would be lost, so please consider the above.

Re: Foreach-Object not recognized as internal or external commands, etc
I want to make sure that you opened an elevated PowerShell, not Command prompt, window. The Foreach-Object is a Powershell command is not recognized in a Command prompt.
and a follow up - you had a similar issue with cmds, but I'm not certain how that was resolved. I made a few suggestions and your response was "After that test... it worked" I'm still not clear on what "test"

It is imperative that members know what you've done, what suggestion proved helpful.

So I'll ask one more time:
Quote   Quote: Originally Posted by sgmdew View Post
After running this test I tried sfc and it ran this time .....
What test did you run that made SFC work for you?

Let's continue reaching a resolution in your new thread, ok?

Thanks,

Bill
.
My System SpecsSystem Spec
24 May 2014   #93
Slartybart

x64 (6.3.9600) Win8.1 Pro & soon dual boot x64 (6.1.7601) Win7_SP1 HomePrem
 
 

sgmdew,

Thanks for starting a new thread here.
Clear Admin Log
My System SpecsSystem Spec
.

13 Oct 2014   #94
TechFA

Windows 8.1 Pro
 
 
Clear System Log Again - Cleanup

After running the script, a few entries are added into the system event log that certain logs were cleared. This is due to the script clearing them alphabetically and several are cleared after the system event log. I wanted it to be super tidy so I added another line to clear the system event log one more time after everything else was cleared. Not sure if this is the best way to do it but thought I'd share my modification.

I have also confirmed that this script works great on Windows 8.1 and Windows 2012 R2.

Code:
@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")
wevtutil.exe cl System
echo.
echo Event Logs have been cleared! ^<press any key^>
goto theEnd
:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
:noAdmin
echo You must run this script as an Administrator!
echo ^<press any key^>
:theEnd
pause>NUL
My System SpecsSystem Spec
20 Nov 2014   #95
QA arvin

Windows 7 Ultimate x64
 
 

Hi Zardoc,

Thanks for your sharing, but I have a question that how to clear the Windows log just the part of system, it's only need to clear the system log under Window logs. Thanks in advance!
My System SpecsSystem Spec
20 Nov 2014   #96
Brink

64-bit Windows 10 Pro
 
 

Hello Arvin, and welcome to Seven Forums.

You could clear the "System" log under "Windows Logs" in Event Viewer by selecting System, then clicking on Clear log in the far right "Actions" pane like below.

Event Viewer One Click Clear-system_log.jpg


My System SpecsSystem Spec
20 Nov 2014   #97
QA arvin

Windows 7 Ultimate x64
 
 

Hi Brink,

Thanks for your reply, if I'd like to clear the system log with one click completed, so how to do work using the bat command?
My System SpecsSystem Spec
28 Nov 2014   #98
fuzzydorito

Micro$oft 64-bit
 
 

Here is my code for those wanting an even smaller batch file and quicker clean:

Step 1: Copy/Paste the code into Notepad.
Code:
@echo off
for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :clear "%%G")
:clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
exit
Step 2: Save as "All Files" and make sure you have ".bat" at the end of the name.
Step 3: Right click on the newly saved bat file, and click "Send to.. Desktop"
Step 4: Right click on the newly made shortcut on the Desktop and click "Properties" then click "Advanced" then check the box "Run as Administrator" and hit "OK"

Now you can simply double click the shortcut at your leisure and quickly clear event logs. No annoying Yes|No prompts to clear logs and no "click to exit prompt" pauses after clearing and all done with 141 bytes of code.
My System SpecsSystem Spec
28 Nov 2014   #99
sgmdew

Win 7 Pro 64 Bit
 
 

Thanks, works great win 7Pro, 64bit
My System SpecsSystem Spec
Reply

 Event Viewer One Click Clear




Thread Tools




Similar help and support threads
Thread Forum
How To Clear Administrative Events Log - Event Viewer
Hi: Does anyone know how to clear the Administrative Events log listed under Custom Views in the Event Viewer? All the logs listed under the Windows logs have options to clear, but the above does not. Thanks, ColTom2
Performance & Maintenance
Event Viewer: Clear All Events
How to Clear all Event Logs in Event Viewer using Windows PowerShell This tutorial will show you how to quickly clear all event logs in Event Viewer with a one line PowerShell script. This one line command clears each log in the Event log list one at a time. wevtutil el gets the Event log...
Tutorials
Event Viewer Event Id 2002, Source: EapHost, Log Application
Well, I tryed to manage page-file but unfortunataly it resulted in problems. Then I lost VAIO-CARE and 7 ZIP files too. When I open Event Viewer every single day I see this: event Id 2002, Souce: Eap Host, Log name: Application and number of Eventes: 84. As I am desparate about that, What sould...
General Discussion
BSOD when watching videos on youtube, Event 41 in Event Viewer
It's been a while since I've experienced a BSOD as I'm viewing a video on youtube. It would freeze as if the audio was caught in mid-stream then BSOD, then would restart automatically. I go to Event Viewer after windows as loaded and I see Event 41 Kernel-Power in there. I had this issue...
BSOD Help and Support
After BSOD Event Viewer Logs Event ID 3012 and 3011 every time I boot
I was running 3DMark06 and got a BSOD code 124. After that every time I boot Event Viewer logs Error Codes ID 3012 and 3011. Attached are screenshots of both. I googled this and found two different threads where someone suggested to rebuild the performance counters. Both responses were...
BSOD Help and Support
WHEA-Logger event 18/19 errors in Event Viewer (W7 Home Premium)
Hi, I was hoping somebody could offer an insight on the below, as searching around I've not found much to go on other than "overheating" Basically my laptop has been having very high temperatures for a long time (usually ~60C for CPU and often 100-110 for GPU...insanely high, in other words)...
Hardware & Devices


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 19:52.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App