Advertisement
Guest User

Untitled

a guest
Feb 13th, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. @echo off
  2. FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V
  3. IF (%adminTest%)==(Access) goto noAdmin
  4. for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
  5. echo.
  6. echo Event Logs have been cleared! ^<press any key^>
  7. goto theEnd
  8. :do_clear
  9. echo clearing %1
  10. wevtutil.exe cl %1
  11. goto :eof
  12. :noAdmin
  13. echo You must run this script as an Administrator!
  14. echo ^<press any key^>
  15. :theEnd
  16. pause>NUL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement