Event Viewer One Click Clear

How to Clear Event Viewer with One Click in Windows


   Information
This will show you how to create a command line shortcut that will clear all of the Event Viewer logs in one click.



Here is a batch file that can help you clear the event viewer in one click.

Download


Download this file above..

Unzip on your desktop.

You can use the task scheduler to give it a high priority so you won't get a UAC prompt

See Brink's Tip HERE

Or, just copy this script and paste in notepad and save as Clean Viewer.BAT

Right click, and click on Run as administrator to run the file
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")
echo.
echo goto theEnd
:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
:noAdmin
exit

:geek:






 
Last edited by a moderator:
OK Zardoc.... You DID get mine smaller, BUT....... :devil::devil::devil:

Here is the even SMALLER version!
Code:
@echo off
FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V
IF (%adminTest%)==(Access) goto theEnd
for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
goto theEnd
:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
:theEnd

(d)
 

My Computer My Computer

Computer Manufacturer/Model Number
HP DV7-2270US
OS
Windows 7 64-bit
CPU
Intel Core 2 quad (2000MHZ, 4 core)
Motherboard
HP
Memory
4 Gig
Graphics Card(s)
ATI HD4650
Sound Card
IDT HD and ATI HD
Monitor(s) Displays
17" wide laptop and 65" secondary (for 'work' :) )
Screen Resolution
1600X900
Hard Drives
Patriot 64-Gig M28 SSD in bay 1
Seagate ST9500420AS 500 Gig in bay 2(laptop)
Case
HP Laptop
Internet Speed
T3
Batch files are fun!!!
 

My Computer My Computer

Computer Manufacturer/Model Number
Dell XPS 8300
OS
Win7 x64
CPU
Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
Memory
16GB Dual-Channel
Graphics Card(s)
NVIDIA GeForce GTS 450
Monitor(s) Displays
Viewsonic VX2753mh-LED 27" HDMI
Screen Resolution
1920x1080
Wow, thanks for that. You know I had this problem of course. In XP, its much easier to clear the event viewer than Vista and Windows 7 because in those two, you have to manually clear every log category than in Windows XP that lets you clear all logs on just 4 categories.

Maybe you guys can teach me with these command prompts hacks.
 

My Computer My Computer

Computer Manufacturer/Model Number
Custom Built
OS
Windows 7 Ultimate 32 Bit, Windows Developer Preview, Linux Mint 9 Gnome 32 Bit
CPU
Intel Pentium Dual CPU E2180@2GHz
Motherboard
Elitegroup 671T-M3
Graphics Card(s)
NVIDIA GeForce 7200 GS
Monitor(s) Displays
AOC TFT1560 15" LCD Monitor
Screen Resolution
1024x768
Keyboard
Logitech USB Keyboard
My Pleasure.

Fun to save time.
 

My Computer My Computer

Computer Manufacturer/Model Number
Asus
OS
Windows 7 x64 Ultimate SP1
CPU
I5 875K Unlocked
Motherboard
P7P55D-E-PRO
Memory
Kingston HyperX Genesis DDR3-1600MHz 9-9-9-27 @ 1.65V XMP
Graphics Card(s)
EVGA GeForce GTX 570 HD 732 MHz GPU 1280 MB, 152 GB Mem
Sound Card
Onboard Via 1828S
Monitor(s) Displays
Samsung T240 HD
Screen Resolution
Dual 1920X1200 1027X768
Hard Drives
OCZ Vertex II Extended Sandforce SSD 60 Gig 2X WD Black Caviar 1 terabyte 6GBS Transer Sata 3 Marvell Chip
PSU
Corsair Gold fully Modular 80 Plus 850
Case
Coolermaster Half X Full Tower
Cooling
Noctua NH-U12P
Keyboard
MS
Mouse
MS
Internet Speed
Fast enough
Other Info
My fridge has a water tap
Thats very helpful tool!!!! nice job!!! :D :D :D
 

My Computer My Computer

OS
Windows 7 Ultimate x64
THANK YOU.
 

My Computer My Computer

Computer Manufacturer/Model Number
Asus
OS
Windows 7 x64 Ultimate SP1
CPU
I5 875K Unlocked
Motherboard
P7P55D-E-PRO
Memory
Kingston HyperX Genesis DDR3-1600MHz 9-9-9-27 @ 1.65V XMP
Graphics Card(s)
EVGA GeForce GTX 570 HD 732 MHz GPU 1280 MB, 152 GB Mem
Sound Card
Onboard Via 1828S
Monitor(s) Displays
Samsung T240 HD
Screen Resolution
Dual 1920X1200 1027X768
Hard Drives
OCZ Vertex II Extended Sandforce SSD 60 Gig 2X WD Black Caviar 1 terabyte 6GBS Transer Sata 3 Marvell Chip
PSU
Corsair Gold fully Modular 80 Plus 850
Case
Coolermaster Half X Full Tower
Cooling
Noctua NH-U12P
Keyboard
MS
Mouse
MS
Internet Speed
Fast enough
Other Info
My fridge has a water tap
Many thanks. I didn't even know that we had this until LasyB mentioned same.

When testing, I like to get rid of the old events first and this is an excellent solution.
 

My Computer My Computer

Computer Manufacturer/Model Number
Toshiba Satellite S875D-S7239 laptop
OS
MS Windows 7 Ultimate SP1 64-bit
CPU
AMD A10-4600M
Motherboard
AMD Pumori (Socket FT1)
Memory
6.00 GB Dual-Channel DDR3 @ 798MHz (11-11-12-28)
Graphics Card(s)
AMD Radeon HD 7660G
Sound Card
High Definition Audio Device
Monitor(s) Displays
Generic PnP Monitor (1600x900@60Hz)
Screen Resolution
1600x900@60Hz
Hard Drives
SSD 119GB Corsair CSSD-V128GB2 ATA Device
Keyboard
Standard PS/2 Keyboard
Mouse
HP Wireless Optical Mobile Mouse Model FHA-3410
Internet Speed
What the local pub, local coffee shop offers.
Other Info
Optical Drive:MATSHITA BD-CMB UJ160B ATA Device


Also have an Asus ha1002xp netbook with Win 7 Ultimate installed.
My pleasure.
 

My Computer My Computer

Computer Manufacturer/Model Number
Asus
OS
Windows 7 x64 Ultimate SP1
CPU
I5 875K Unlocked
Motherboard
P7P55D-E-PRO
Memory
Kingston HyperX Genesis DDR3-1600MHz 9-9-9-27 @ 1.65V XMP
Graphics Card(s)
EVGA GeForce GTX 570 HD 732 MHz GPU 1280 MB, 152 GB Mem
Sound Card
Onboard Via 1828S
Monitor(s) Displays
Samsung T240 HD
Screen Resolution
Dual 1920X1200 1027X768
Hard Drives
OCZ Vertex II Extended Sandforce SSD 60 Gig 2X WD Black Caviar 1 terabyte 6GBS Transer Sata 3 Marvell Chip
PSU
Corsair Gold fully Modular 80 Plus 850
Case
Coolermaster Half X Full Tower
Cooling
Noctua NH-U12P
Keyboard
MS
Mouse
MS
Internet Speed
Fast enough
Other Info
My fridge has a water tap

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Made by Dixon Butz
OS
Win7 Win 10, Win 8.1
CPU
AMD FX-8350, Corsair H100i
Motherboard
ASUS Crosshair V Formula-Z
Memory
16GB G.SKILL Ripjaws DDR3
Graphics Card(s)
EVGA GTX 980, EVGA GTX 860
Sound Card
Denon x4200 Dolby AMOS!
Monitor(s) Displays
65" Samsung 4K, +3 27inch
Screen Resolution
4K, 1080x3
Hard Drives
2TB Samsung hd204ui

1X Samsung 850 SSD
PSU
1000w EVGA, 2000VA UPS, 1000VA UPS and many others
Case
Lian Li
Cooling
Corsair H100i
Keyboard
Logitech K800
Mouse
Logitech Couch Mouse
Internet Speed
Gigabit!
Antivirus
Defender
Browser
Slimjet Chrome
My Pleasure.

:geek:
 

My Computer My Computer

Computer Manufacturer/Model Number
Asus
OS
Windows 7 x64 Ultimate SP1
CPU
I5 875K Unlocked
Motherboard
P7P55D-E-PRO
Memory
Kingston HyperX Genesis DDR3-1600MHz 9-9-9-27 @ 1.65V XMP
Graphics Card(s)
EVGA GeForce GTX 570 HD 732 MHz GPU 1280 MB, 152 GB Mem
Sound Card
Onboard Via 1828S
Monitor(s) Displays
Samsung T240 HD
Screen Resolution
Dual 1920X1200 1027X768
Hard Drives
OCZ Vertex II Extended Sandforce SSD 60 Gig 2X WD Black Caviar 1 terabyte 6GBS Transer Sata 3 Marvell Chip
PSU
Corsair Gold fully Modular 80 Plus 850
Case
Coolermaster Half X Full Tower
Cooling
Noctua NH-U12P
Keyboard
MS
Mouse
MS
Internet Speed
Fast enough
Other Info
My fridge has a water tap
Works as advertised, thanks
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
My own abomination, I call it the Money Pit
OS
Windows 10 Pro x 2/Windows 11 Home
CPU
Intel i7 2600K @ 3.40 GHz
Motherboard
ASUS Sabertooth P67
Memory
Corsair Vengeance 16GB DDR3 1600MHz CL8 Dual Channel Kit
Graphics Card(s)
EVGA GeForce RTX 3080 XC3 ULTRA GAMING 10GB GDDR6X
Sound Card
Onboard Realtek or Nvidia High Definition Audio (HDMI)
Monitor(s) Displays
Samsung JS7000 50" SUHD TV or Samsung 27" FHD 60Hz 8ms GTG V
Screen Resolution
1920 x 1080
Hard Drives
1 x Samsung 870 EVO 250 GB SSD (Windows 10 Pro), 1 x Samsung 850 EVO 250 GB SSD (Windows 10 Pro)
PSU
Corsair AX860 - 860W Modular Power Supply
Case
Phanteks Enthoo Luxe Full Tower Case - Black
Cooling
CORSAIR Hydro Series H150i PRO RGB 360mm Liquid CPU Cooler
Keyboard
Logitech K830 Illuminated Living-Room Keyboard
Mouse
Logitech MX Anywhere 2S Wireless Mouse
Internet Speed
100 Mbps
Antivirus
ESET Internet Security
Browser
Latest Version Of Firefox & Microsoft Edge Chromium Stable
Other Info
LG Super Multi Blue Internal Blu-ray Disk Rewriter - BH10LS30
6x2 HDMI Switcher (6 inputs, 2 outputs) so I can send the output of my Cable Box, Roku, or any my 4 computers to either my TV or Monitor separately or simultaneously.
My pleasure.
 

My Computer My Computer

Computer Manufacturer/Model Number
Asus
OS
Windows 7 x64 Ultimate SP1
CPU
I5 875K Unlocked
Motherboard
P7P55D-E-PRO
Memory
Kingston HyperX Genesis DDR3-1600MHz 9-9-9-27 @ 1.65V XMP
Graphics Card(s)
EVGA GeForce GTX 570 HD 732 MHz GPU 1280 MB, 152 GB Mem
Sound Card
Onboard Via 1828S
Monitor(s) Displays
Samsung T240 HD
Screen Resolution
Dual 1920X1200 1027X768
Hard Drives
OCZ Vertex II Extended Sandforce SSD 60 Gig 2X WD Black Caviar 1 terabyte 6GBS Transer Sata 3 Marvell Chip
PSU
Corsair Gold fully Modular 80 Plus 850
Case
Coolermaster Half X Full Tower
Cooling
Noctua NH-U12P
Keyboard
MS
Mouse
MS
Internet Speed
Fast enough
Other Info
My fridge has a water tap
Awesome one!
 

My Computer My Computer

Computer Manufacturer/Model Number
Brewed
OS
Microsoft Windows 7 Ultimate: x64 (SP1)
CPU
Intel® Core™ i5-2500K Processor
Motherboard
ASUS P8Z68-V PRO
Memory
Kingston DDR3 HyperX 1600MHz 8GB
Graphics Card(s)
ASUS GTX 560 TI DirectCU II 900MHz
Sound Card
Realtek® ALC892 8-Channel High Definition Audio CODEC
Monitor(s) Displays
ACER LCD P246HBD 1920x1080 (24") - Dell 1280x800
Screen Resolution
ACER LCD P246HBD ~ [1920X1080] - DELL ~ [1280x800]
Hard Drives
500 GB WD Caviar SE116 7200rpm SATA2
PSU
Corsair 750W Power Supply
Case
Coolermaster CM Scout
Cooling
Zalman FS-C77 Fatal1ty CPU Cooler
Keyboard
Logitech G15
Mouse
Coolermaster Sentinel Advanced
Internet Speed
[↓ 10 MB/s DL] [↑ 1 MB/s UL]
Other Info
- ROCCAT™ Kave – Solid 5.1 Surround Sound Gaming Headset
- Not overclocking

My Computer My Computer

Computer Manufacturer/Model Number
Asus
OS
Windows 7 x64 Ultimate SP1
CPU
I5 875K Unlocked
Motherboard
P7P55D-E-PRO
Memory
Kingston HyperX Genesis DDR3-1600MHz 9-9-9-27 @ 1.65V XMP
Graphics Card(s)
EVGA GeForce GTX 570 HD 732 MHz GPU 1280 MB, 152 GB Mem
Sound Card
Onboard Via 1828S
Monitor(s) Displays
Samsung T240 HD
Screen Resolution
Dual 1920X1200 1027X768
Hard Drives
OCZ Vertex II Extended Sandforce SSD 60 Gig 2X WD Black Caviar 1 terabyte 6GBS Transer Sata 3 Marvell Chip
PSU
Corsair Gold fully Modular 80 Plus 850
Case
Coolermaster Half X Full Tower
Cooling
Noctua NH-U12P
Keyboard
MS
Mouse
MS
Internet Speed
Fast enough
Other Info
My fridge has a water tap
Oh noes! Infinite loop time! I run the batch file, it clears the logs and makes a few new entries in the logs stating that the log files were cleared. So I run it again to remove those entries and...

Just kidding, this is a great little batch file, thanks to Zardoc & lightningltd!
 

My Computer My Computer

Computer Manufacturer/Model Number
Dell E520
OS
Windows 7 Enterprise x64 SP1, Ubuntu 11.04 x64
CPU
Core2Quad Q6700 - 2.66 GHz
Motherboard
Whatever the heck Dell put in there...
Memory
8 Gig Mushkin DDR2 800 MHz
Graphics Card(s)
EVGA NVIDIA 9800GT - 512MB DDR3
Monitor(s) Displays
2 x 19" ViewSonic LCD
Screen Resolution
2560x1024
Hard Drives
1 Intel X25-M 120G SSD, 1 300G VelociRaptor, 1 WD Caviar Black 1TB
PSU
PCPower & Cooling Silencer 500 Watt
Internet Speed
15/2 Roadrunner Cable
Other Info
NOD32 AV - Malwarebytes
So you wanted to yank my chain?

;)

You're welcome.
 

My Computer My Computer

Computer Manufacturer/Model Number
Asus
OS
Windows 7 x64 Ultimate SP1
CPU
I5 875K Unlocked
Motherboard
P7P55D-E-PRO
Memory
Kingston HyperX Genesis DDR3-1600MHz 9-9-9-27 @ 1.65V XMP
Graphics Card(s)
EVGA GeForce GTX 570 HD 732 MHz GPU 1280 MB, 152 GB Mem
Sound Card
Onboard Via 1828S
Monitor(s) Displays
Samsung T240 HD
Screen Resolution
Dual 1920X1200 1027X768
Hard Drives
OCZ Vertex II Extended Sandforce SSD 60 Gig 2X WD Black Caviar 1 terabyte 6GBS Transer Sata 3 Marvell Chip
PSU
Corsair Gold fully Modular 80 Plus 850
Case
Coolermaster Half X Full Tower
Cooling
Noctua NH-U12P
Keyboard
MS
Mouse
MS
Internet Speed
Fast enough
Other Info
My fridge has a water tap
Thanks for sharing :*
Have a great day :d

for some reason it does not work on windows xp :(
hix hix
 
Last edited by a moderator:

My Computer My Computer

Computer Manufacturer/Model Number
dell
OS
windows 7 built 7100
@Lightningltd

Great batch file! but I have always wondered, what's with the long pauses between various log clearings?

dev
 

My Computer My Computer

Computer Manufacturer/Model Number
Home Built/Dragon Mach V
OS
Windows 7 x64 Ultimate
CPU
Intel i7 950 3.06GHZ
Motherboard
Asus Rampage III Extreme
Memory
24GB (6x4) 1600mhz DDR2
Graphics Card(s)
ATI Crossfire Dual Card Digital
Sound Card
Creative SB X=Fi Titanium Fatal1ty Pro
Monitor(s) Displays
Asus VH242H 24" DVI LCD
Screen Resolution
1920x1080
Hard Drives
2 - Western Digital Caviar Black 1TB 10,000 SATA 6 internal Drives
1 - Western Digital Cavial Blue 1TB USB External Elements Drive
PSU
OCZ ZX Series 1000 Watt Modular
Case
Icon2 Black Dragon Mach V
Cooling
Mach V Liquid Cooling
Keyboard
Microsoft Sidewinder X4
Mouse
Microsoft Comfort 6000 blue optical wired
Internet Speed
Rated - 20/5 Typical 35/6
Back
Top