florian2833z

clear windows logs

Aug 20th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. @echo off
  2. TITLE EV0LVE WINDOWS LOG CLEANER BY 101-UNITED
  3. COLOR F0
  4. echo SCRIPT BY 101-United
  5. echo Shortened by Flo
  6. echo version 1.0b
  7. goto :admincheck
  8.  
  9.  
  10. :admincheck
  11. net session >nul 2>&1
  12. if %errorLevel% == 0 (
  13. echo Script executed with admin rights, starting the process.
  14. goto :cleanlogs
  15. ) else (
  16. goto :noadmin
  17. )
  18.  
  19. :cleanlogs
  20. for /F "tokens=*" %%G in ('wevtutil.exe el') DO (wevtutil.exe cl "%%G" > nul 2> nul)
  21. goto :success
  22.  
  23.  
  24. :noadmin
  25. CLS
  26. COLOR F4
  27. echo.
  28. echo ###############################################################
  29. echo # You have to run this script as an administrator. exiting... #
  30. echo ###############################################################
  31. timeout 4 >nul
  32. EXIT
  33.  
  34. :success
  35. EXIT
Advertisement
Add Comment
Please, Sign In to add comment