Advertisement
saltinbank

FR Erase log on WINDOWS with batch file

Jan 20th, 2022
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.45 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 sont au Paradis! ^<Press any Key // Presse une Touche^>
  7. goto theEnd
  8. :do_clear
  9. echo effacement %1
  10. wevtutil.exe cl %1
  11. goto :eof
  12. :noAdmin
  13. echo You must run this script as an Admin!
  14. echo ^Press any Key // Presse une Touche^>
  15. :theEnd
  16. pause>NUL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement