Advertisement
chenshaoju

批处理批量清空系统事件(事件查看器)

Sep 18th, 2012
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. REM Author BY http://www.howtogeek.com/forum/topic/clean-logs ,Edit BY @chenshaoju
  2. @echo off
  3. FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V
  4. IF (%adminTest%)==(Access) goto noAdmin
  5. for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
  6. echo.
  7. echo Event Logs have been cleared!
  8. goto theEnd
  9. :do_clear
  10. echo clearing %1
  11. wevtutil.exe cl %1
  12. goto :eof
  13. :noAdmin
  14. echo You must run this script as an Administrator!
  15. echo
  16. :theEnd
  17. pause>NUL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement