New
#90
I changed the code since UTF-8 to ANSI.
The BAT still not run goto noadmin.
I downloaded and applied English US language pack of Windows 10.
After I double clicked the BAT, the BAT ran goto noadmin finally.
I was so sorry that I made you so busy.
Finally, I wanted to said that I hated language pack bug.
Best regards,
Steven.
Last edited by shiwan0804; 02 Jun 2021 at 22:28.
Will this work for Windows 11 users?
Code::: Created by: Shawn Brink :: Created on: August 15th 2016 :: Updated on: July 25th 2018 :: Tutorial: https://www.tenforums.com/tutorials/16588-clear-all-event-logs-event-viewer-windows.html @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 Exit
BTW...I've been using this .bat utility for quite some time now. But I went a couple of steps further with the .bat file: I found "BAT to EXE Converter (64 Bit)" online, and converted it to a .exe file. Then I set the file's compatibility to "run as administrator". All I have to do do now is click it on my desktop and it runs. Hope this helps!