Advertisement
Rick0

LIMPEZA_ARQUIVOS_TEMPORARIOS

Nov 2nd, 2019
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.42 KB | None | 0 0
  1. @ECHO off
  2. pushd "%~dp0"
  3. echo Checando Permissoes...
  4. if not "%1"=="am_admin" ("%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\powershell.exe" start -verb runas '%0' am_admin & exit /b)
  5. CLS
  6. ECHO ENCERRANDO PROCESSOS...
  7. tasklist | find /i "chrome.exe" && taskkill /im "chrome.exe" /F >nul &cls
  8. tasklist | find /i "googleupdate.exe" && taskkill /im "googleupdate.exe" /F >nul &cls
  9. TITLE LIMPEZA DE ARQUIVOS TEMPORARIOS TODOS USUARIOS BY RICK
  10. cls
  11. for /f %%a in ('dir %SYSTEMDRIVE%\users /O-D /B /A:D-S-H') do (
  12. if exist "%SYSTEMDRIVE%\users\%%a\AppData\Local\Temp"  rd "%SYSTEMDRIVE%\users\%%a\AppData\Local\Temp" /s /q & IF NOT EXIST "%SYSTEMDRIVE%\users\%%a\AppData\Local\Temp" MD "%SYSTEMDRIVE%\users\%%a\AppData\Local\Temp" >nul
  13. if exist "%SYSTEMDRIVE%\users\%%a\AppData\Local\Google\Chrome\User Data\Default\Cache" rd "%SYSTEMDRIVE%\users\%%a\AppData\Local\Google\Chrome\User Data\Default\Cache" /s /q >nul
  14. if exist "%SYSTEMDRIVE%\users\%%a\AppData\Local\Google\Chrome\User Data\Default\*history*.*" del "%SYSTEMDRIVE%\users\%%a\AppData\Local\Google\Chrome\User Data\Default\*history*.*" /s /q >nul
  15. if exist "%SYSTEMDRIVE%\users\%%a\AppData\Local\Google\Chrome\User Data\Default\*History Provider Cache*.*" del "%SYSTEMDRIVE%\users\%%a\AppData\Local\Google\Chrome\User Data\Default\*History Provider Cache*.*" /s /q >nul
  16. if exist "%SYSTEMDRIVE%\users\%%a\AppData\Local\Google\Chrome\User Data\Default\*cookies*.*" del "%SYSTEMDRIVE%\users\%%a\AppData\Local\Google\Chrome\User Data\Default\*cookies*.*" /s /q >nul
  17. )
  18. rd  "%systemdrive%\$Recycle.bin" /s /q >nul
  19. cls
  20. echo .::Procurando Tarefas Agendadas Chrome::.
  21. for /f "tokens=2 delims=\" %%x in ('schtasks /query /fo:list ^| findstr ^^GoogleUpdateTask') do SCHTASKS /End /TN "%%x" >nul && SCHTASKS /Delete /TN "%%x" /F >nul
  22. echo .::Procurando tarefa agendada de Feed::.
  23. for /f "tokens=2 delims=\" %%x in ('schtasks /query /fo:list ^| findstr ^^User_Feed_Synchronization') do SCHTASKS /End /TN "%%x" >nul && SCHTASKS /Delete /TN "%%x" /F >nul
  24. echo .::Procurando Tarefas Adobe::.
  25. for /f "tokens=2 delims=\" %%x in ('schtasks /query /fo:list ^| findstr ^^Adobe') do SCHTASKS /End /TN "%%x" >nul && SCHTASKS /disable /TN "%%x" /F >nul
  26.  
  27. cls
  28. ::DESABILITANDO SERVICOS
  29. SET "disable_services=gupdatem,GoogleChromeElevationService,gusvc,gupdate"
  30. for %%i in (%disable_services%) do (
  31. SC query %%i | FIND /i "STOPPED" >nul & IF ERRORLEVEL 1 SC stop %%i >nul
  32. SC config %%i start= disabled >nul
  33. )
  34. PAUSE
  35. EXIT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement