Advertisement
FreeBooter

ClearEventLogs.bat

Oct 29th, 2016
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.63 KB | None | 0 0
  1. :: Created by FreeBooter
  2. :: www.dost-tech.com
  3. @Echo Off & Cls
  4. Call :NoAdmin
  5. Mode CON  LINES=33 COLS=85
  6. For /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
  7. Echo.
  8. Echo                    Event Logs Have Been Cleared!
  9. Ping -n 5 127.0.0.1 >Nul
  10. Goto :eof
  11. :do_clear
  12. Echo clearing %1
  13. wevtutil.exe cl %1
  14. Goto :eof
  15.  
  16. :NoAdmin
  17. Reg query "HKU\S-1-5-19\Environment"
  18. If Not %ERRORLEVEL% EQU 0 (
  19.  Cls & Mode CON  LINES=5 COLS=48 & Color 0C &  Title  .....................- WARNING -.......................
  20.  Echo.
  21.  Echo.
  22.  Echo  YOU MUST HAVE ADMINISTRATOR RIGHTS TO CONTINUE
  23.  Pause >Nul & Exit
  24. )
  25.  Cls
  26.  Goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement