REM Different System Trash Cleaner
REM Cleans almost any kind of system trash files.
@ECHO off
SETLOCAL
SET "ds=Documents and Settings"
SET "tf=Local Settings\Temp"
SET "ti=Local Settings\Temporary Internet Files"
ECHO Start....
FOR %%i in (Q W E R T Y U I P O S D F G H J K L Z X C V N M) do ( 
IF not %~d0==%%i:  call:clean %%i 
)
ECHO ....Done
goto:eof
:clean
IF EXIST %1:\Windows\Temp  ( 
PUSHD %1:\Windows\Temp
call:delete
POPD
)
IF EXIST %1:\WinNT\Temp  ( 
PUSHD %1:\WinNT\Temp
call:delete
POPD
)
::
:: Recycle Bin
::
IF EXIST %1:\Recycler  ( 
PUSHD %1:\Recycler
call:delete
POPD
)
IF EXIST %1:\Recycled  ( 
PUSHD %1:\Recycled
call:delete
POPD
)
::
:: System restore points
::
IF EXIST "%1:\System Volume Information\*_restore*"  ( 
PUSHD "%1:\System Volume Information\*_restore*"
FOR /f %%i in ('dir /b /ad') do RD %%i /s /q
POPD
)
IF not EXIST "%1:\%ds%"  goto:eof 
FOR /f "tokens=*" %%i in ('dir /b /ad "%1:\%ds%" ') do ( 
IF EXIST "%1:\%ds%\%%i\%tf%"  ( 
PUSHD "%1:\%ds%\%%i\%tf%"
call:delete
POPD
)
IF EXIST "%1:\%ds%\%%i\%ti%"  ( 
PUSHD "%1:\%ds%\%%i\%ti%"
call:delete
POPD
)
)
goto:eof
:delete
DEL *.* 1 /f /q /a > nul 2>&1
FOR /f "tokens=*" %%i in ('dir /b /ad') do RD "%%i" 1 /s /q > nul 2>&1
