Advertisement
Guest User

Clear MS Logs

a guest
Oct 13th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.28 KB | None | 0 0
  1.  
  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 goto theEnd
  8. :do_clear
  9. echo clearing %1
  10. wevtutil.exe cl %1
  11. goto :eof
  12. :noAdmin
  13. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement