Advertisement
Thibstars

Clear temp folder

Apr 29th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.29 KB | None | 0 0
  1. @echo off
  2. setlocal
  3. call :Clear_Folder %SystemRoot%\TEMP
  4. pushd C:\Users
  5. for /d %%k in (*) do if exist "%%k\AppData\Local\Temp" call :Clear_Folder "%%k\AppData\Local\Temp"
  6. popd
  7. endlocal
  8. goto :EOF
  9.  
  10. :Clear_Folder
  11. pushd "%~1"
  12. for /d %%i in (*) do rd /s /q "%%i"
  13. del /f /q *
  14. popd
  15. goto :EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement