Windows 7 - clearing Administrative Events


Recommended Posts

Hi

Off topic I know but I was a Neowin forum member many, many years ago and I have just come back and I need to thank Neowin MODS/Admin for helping me get my password reset.

Ok, I am running Windows 7 as my primary OS and I really like it. It installed without problems and I needed no drivers so i was able to use the OS right from the start but, I have one annoying problem which I would like help with please.

The problem is with regard to the Event Viewer: When I go to event viewer, I can clear all the logs with the exception of Administrative Events which is shown under Event Viewer/Custom Views. This log has no "Clear logs" option when i right-click it and I would really like to clear it. Can anyone help please?

Regards

Hi ViperAFK

Thanks for your fast response.

ccleaner? Is there no option in windows 7 that I may have missed or that is hidden?

Just out of interest, are you running Windows 7 beta and if so, do your Administrative Events log have loads of errors/warnings in it?

At the moment, my log has around 223 events but they cover about three or four events which are all the same and just keep repeating each time I boot the notebook. Two examples below:

Log Name: Microsoft Windows-Dhcpv6-Client/Admin

Your computer was not assigned an address from the network (by the DHCP Server) for the Network Card with network address 0x001B7772D389. The following error occurred: 0x79. Your computer will continue to try and obtain an address on its own from the network address (DHCP) server.

Log Name: System

Source: Microsoft-Windows-WLAN-AutoConfig

WLAN AutoConfig service has successfully stopped.

Regards

To clear all the logs (well, most of them) in one shot, paste the following code into a text file and save it as clearlogs.bat. I stole this from another board (don't remember which one) fair and square and would give the author his/her due if I could remember. It has not been updated for Win7 yet, but works. Should be easy to mod for some of the new logs.

Begin 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 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

End Code

Would have attached it, but it was disallowed.

Hi magic-man

That was amazing man. :o

It worked 100%, the .bat file cleared absolutely loads of logs including the 'admin events' log and I never new that many logs existed.

Naturally I'm very grateful to you for sharing this file with me but the problem is that I'm no expert on these .bat files and so I'm not sure of the validity of the it, or how secure it is to use?

For all I know, it could be planting spyware, trojans or worse, on my computer.

Is there anyway I can be sure about this .bat file?

If any MODS or ADMIN are monitoring the these forums, I'd like your advice on this file and how safe it is to use.

Regards

Hi magic-man

That was amazing man. :o

It worked 100%, the .bat file cleared absolutely loads of logs including the 'admin events' log and I never new that many logs existed.

Naturally I'm very grateful to you for sharing this file with me but the problem is that I'm no expert on these .bat files and so I'm not sure of the validity of the it, or how secure it is to use?

For all I know, it could be planting spyware, trojans or worse, on my computer.

Is there anyway I can be sure about this .bat file?

If any MODS or ADMIN are monitoring the these forums, I'd like your advice on this file and how safe it is to use.

Regards

The first 2 lines simply see if you have admin access. The actual clearing of the log is done by a built in utiliy in Win7 and vista.

The only executable in use for this is wevtutil.exe. Personally, I read the batch file and then googled wevtutil.exe to make sure the /cl command was not doing anything evil.

This site http://technet.microsoft.com/en-us/library/cc732848.aspx describes wevtutil (very useful).

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Universal USB Installer 2.0.3.7 by Razvan Serea The Universal USB Installer (UUI) is a powerful bootable USB software tool for creating USB boot drives from ISO files, perfect for installing Linux or Windows, running live systems, or building diagnostic toolkits. This versatile ISO-to-USB software makes it easy to boot from USB and create Live USBs for Linux distributions, Windows setup installers, antivirus tools, and system diagnostic utilities. Whether you need a multisystem Windows Media Creation Tool, a Live USB Linux installer, or an all-in-one PC diagnostic toolkit, UUI offers a reliable and flexible Linux and Windows bootable USB creator. Effortlessly carry your favorite portable operating systems and essential troubleshooting and diagnostic tools on a single flash drive or USB boot stick. Take your preferred Live Linux distributions, Windows installers, recovery software, backup utilities, and diagnostic tools with you, all bootable from a single USB drive. No more juggling multiple USB sticks or complicated bootloaders, UUI consolidates everything into one flexible, multiboot solution. Using this open source USB boot maker software is easy as 123. To create a Linux or Windows bootable USB drive, you simply select your target flash drive, choose your distribution from the list, browse to the ISO file (or choose to download the ISO), and then click Create. Once finished, you should have a ready to run Live USB containing the Live operating system, Windows installation media, or system diagnostics utility, or advanced system cleaner tool you previously selected. Universal USB Installer 2.0.3.7 changelog: Expanded the distro and tool catalog with additional popular Linux ISO entries. Updated: several distro homepage and download links, including Ubuntu Unity, Garuda Linux, Arch Linux, Fedora, Manjaro, and SystemRescue. Fixed: ISOs added via drag and drop (or manually copied to the drive) are now listed in the removal dropdown alongside normally installed distros. Download: Universal USB Installer 2.0.3.7 | 19.4 MB (Open Source) Link: Universal USB Installer Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • You are clueless. The updates are done in the background so the next time you open Edge the updates are applied automatically. There is no need to close all your tabs. Just keep browsing like you normally do. Clearly you don't use Edge and are just one of those haters that complain for the sake of complaining.
    • I don't get this David. Can you explain it please.  
    • Microsoft is busy. Lots of changes to be released imminently for Windows server or soon. Also, lots happening for next version as well. Third party virus scanning software is being moved out of Kernel mode to avoid repeat of Crowdstrike incident. Windows Protected Mode and Windows Ready Print no longer require third party print drivers to be installed. New storage stack being developed. New NVME drivers now available for Windows Server 2025 to improve local NVME drive performance by 60+ percent. NVME-Of of fabric being worked on for next release to improve network access to NVME drives. ReFs (next file system) now has ability to boot and will become default file system in next release of Windows Server. ReFs improves on NTFS in several areas including resiliency and reliability and scalability. New update stack is being worked on to unify Windows updates, and updates for drivers and first party/3rd party application software. A stricter and more robust third-party driver certification program (ODI) is being worked on to improve performance, thermals, battery life, and reliability on modern Windows hardware by tightening how OEMs and IHVs (Intel, AMD, Qualcomm, NVIDIA, etc.) build and ship drivers. There is a tone more but too numerous to mention.
  • Recent Achievements

    • Rookie
      Rimplesnort went up a rank
      Rookie
    • One Month Later
      Markus94287 earned a badge
      One Month Later
    • Week One Done
      Markus94287 earned a badge
      Week One Done
    • One Year In
      Markus94287 earned a badge
      One Year In
    • Dedicated
      truespursfan earned a badge
      Dedicated
  • Popular Contributors

    1. 1
      +primortal
      507
    2. 2
      +Edouard
      168
    3. 3
      PsYcHoKiLLa
      154
    4. 4
      ATLien_0
      90
    5. 5
      Steven P.
      79
  • Tell a friend

    Love Neowin? Tell a friend!