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

    • Quantum Error Correction Validated in Nature: Microsoft and Quantinuum Log 800-Fold Improvement Two years after the original press-release announcement, independently peer-reviewed results published in Nature on June 10, 2026, have confirmed that Microsoft and Quantinuum achieved an 800-fold reduction in quantum error rates on real trapped-ion hardware — the largest gap between physical and logical error rates ever independently validated.    What Quantum Error Correction Actually Does — and Why Breaking Even Is Hard https://www.techtimes.com/articles/318329/20260613/quantum-error-correction-validated-nature-microsoft-quantinuum-log-800-fold-improvement.htm   Quantum Computing Wiring Bottleneck Cracked by HKU Silicon Carbide Chip at Qubit Temperature Engineers at the University of Hong Kong have built the first cryogenic control chip that operates at the same temperature as superconducting qubits — 10 millikelvin, or just one-hundredth of a degree above absolute zero — without generating the heat that has forced every competing approach to park its electronics hundreds of meters of cable away. https://www.techtimes.com/articles/318325/20260613/quantum-computing-wiring-bottleneck-cracked-hku-silicon-carbide-chip-qubit-temperature.htm  
    • RevPDF 4.5.0 by Razvan Serea RevPDF is a free, fully offline PDF editor for Windows, macOS, and Linux that lets you edit text and images directly inside PDF files — no internet connection, no account, and no cloud uploads required. Unlike bloated alternatives that demand subscriptions and constant connectivity, RevPDF fits in under 60MB on desktop while delivering a complete editing toolkit: annotate, redact, sign, compress, split, merge, convert, and reorganize pages, all processed locally on your device. Smart font matching ensures edited text blends seamlessly with the original, and multi-language support includes RTL scripts such as Arabic and Hebrew. Where most PDF editors force you to choose between features and simplicity, RevPDF manages both. You can build interactive forms from scratch with text fields, checkboxes, and dropdowns, permanently redact sensitive data before sharing, draw freehand on contracts and diagrams, and add custom watermarks — all without a single file leaving your machine. Edit Text and Images Directly Inside PDFs RevPDF supports true inline PDF editing — not just annotation layers on top of a document, but actual modification of existing text and images within the file. A smart font-matching engine identifies the font used in the original document and applies it automatically when you make edits, so changes blend naturally with the surrounding content. You can reposition elements, resize images, and update text across single pages or entire documents. RevPDF 4.5.0 release notes: This is one of the biggest updates to RevPDF yet. A lot of things people have been asking for are finally here. New Features Auto Redaction Permanently redact sensitive text and areas from your PDFs before sharing. Clean, irreversible, and fully offline. Comments, Links & Bookmarks Add comments for review, insert clickable links, and create bookmarks to jump around long documents without scrolling forever. Find & Replace Search across the whole document and replace text in one go. Long overdue. Split Pages Vertically or Horizontally Split any page down the middle, vertically or horizontally. Perfect for scanned books or double-page spreads. New Drawing Tools More tools for freehand drawing and markup, better for annotations, sketches, and detailed notes. Continuous Scrolling in Editor The editor now scrolls continuously through pages instead of jumping between them. Working through long documents is a lot smoother now. PDF Metadata Editor View and edit the metadata stored inside your PDFs, including title, author, subject, and keywords. Better Font Matching Text edits now blend in more naturally by doing a better job of matching the original font. Tabbed PDF Viewer Open multiple PDFs at once in tabs and switch between them without going back to the home screen. Add Links Insert hyperlinks anywhere in your PDF, to external URLs or to other pages within the document. Share & Print Shortcuts Share or print directly from the editing screen, home screen, and viewer. No extra steps. Minor Updates Paste images directly from clipboard into your PDF New image editing tools for more control over images inside documents Bug Fixes Fixed file saving issues on Windows and Linux Everything still works fully offline. No login, no cloud, no account. Your files stay on your device. Download: RevPDF 4.5.0 | 58.0 MB (Open Source) Links: RevPDF Home Page | Github | Screenshots 1 | 2 Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Interesting. I'm not using a VPN with my phone. I tried though my home internet (Rogers) and my cellular internet (Telus) using their respective DNS servers and both trigger the dialog above.
    • Three days after Anthropic launched Claude Fable 5 as the most capable AI model it had ever released to the public, the United States government ordered it switched off — and now the company is refunding customers who paid to use a product that vanished almost overnight https://www.techtimes.com/articles/318342/20260613/us-government-pulls-anthropics-fable-5-offline-now-come-refunds-vanished-ai.htm  
    • Microsoft fired the team and replaced them with AI and this is what you get.
  • Recent Achievements

    • Week One Done
      agatameier earned a badge
      Week One Done
    • One Month Later
      agatameier earned a badge
      One Month Later
    • Week One Done
      ssd21345 earned a badge
      Week One Done
    • Contributor
      MarkHughes4096 went up a rank
      Contributor
    • Dedicated
      jordanspringer earned a badge
      Dedicated
  • Popular Contributors

    1. 1
      +primortal
      507
    2. 2
      +Edouard
      175
    3. 3
      PsYcHoKiLLa
      139
    4. 4
      ATLien_0
      90
    5. 5
      Steven P.
      76
  • Tell a friend

    Love Neowin? Tell a friend!