المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to Clean windows temp files



bahattab
30-08-2010, 01:42 PM
How to Clear windows Cache Batch files



make a file and name it " Delete XP Temporary Files v.1.0.3.bat "

edit the " Delete XP Temporary Files v.1.0.3.bat " by the text editor

add the code below

save






IF EXIST %SYSTEMDRIVE%\SYSTEM32\CMDOW.EXE CMDOW @ /HID

@ECHO OFF
TITLE Clean Windows

Echo.
Echo ClearCache 1.1 (2004) for Windows 2000 and XP
Echo Removes temporary files FROM ALL PROFILES.
Echo.
Echo Authors: by Cher Aza, Jimbob60, and Mirfster.
Echo.
Echo Temporary files will be removed from the following locations:
Echo.
Echo 1. [Profile]\Local Settings\Temporary Internet Files
Echo 2. [Profile]\Local Settings\History
Echo 3. [Profile]\Local Settings\Temp
Echo 4. [Profile]\Cookies
Echo 5. [Profile]\Recent
Echo 6. [SystemRoot]\Temp
Echo.
Echo This batch file will close automatically when finished.
Echo.
Echo Press Ctrl+C to abort or any other key to continue . . .
Echo.
PAUSE > NUL
:: Clear local Temporary Internet Files and History
Echo.
Echo The following errors are normal:
RD /S /Q "%Userprofile%\Local Settings\Temporary Internet Files"
RD /S /Q "%Userprofile%\Local Settings\History"
:: Clear all other temporary cache files in all profiles
SET SRC1=C:\Documents and Settings
SET SRC2=Local Settings\Temporary Internet Files
SET SRC3=Local Settings\History
SET SRC4=Local Settings\Temp
SET SRC5=Cookies
SET SRC6=Recent
Echo.
Echo About to delete files from Internet Explorer "Temporary Internet files"
Echo This may take a few minutes. Please wait...
Echo The following error is normal:
FOR /D %%X IN ("%SRC1%\*") DO FOR /D %%Y IN ("%%X\%SRC2%\*.*") DO RMDIR /S /Q "%%Y"
Echo.
Echo About to delete files from Internet Explorer "History"
Echo This may take a few minutes. Please wait...
Echo The following error is normal:
FOR /D %%X IN ("%SRC1%\*") DO FOR /D %%Y IN ("%%X\%SRC3%\*.*") DO RMDIR /S /Q "%%Y"
FOR /D %%X IN ("%SRC1%\*") DO FOR %%Y IN ("%%X\%SRC3%\*.*") DO DEL /F /S /Q "%%Y"
Echo About to delete files from "Local settings\temp"
FOR /D %%X IN ("%SRC1%\*") DO FOR /D %%Y IN ("%%X\%SRC4%\*.*") DO RMDIR /S /Q "%%Y"
FOR /D %%X IN ("%SRC1%\*") DO FOR %%Y IN ("%%X\%SRC4%\*.*") DO DEL /F /S /Q "%%Y"
Echo About to delete files from "Cookies"
FOR /D %%X IN ("%SRC1%\*") DO FOR %%Y IN ("%%X\%SRC5%\*.*") DO DEL /F /S /Q "%%Y"
Echo About to delete files from "Recent" i.e. what appears in Start/Documents/My Documents
FOR /D %%X IN ("%SRC1%\*") DO FOR %%Y IN ("%%X\%SRC6%\*.lnk") DO DEL /F /S /Q "%%Y"
Echo About to delete files from "[SystemRoot]\Temp"
CD /D %SystemRoot%\Temp
DEL /F /Q *.*
RD /S /Q "%SystemRoot%\Temp"
CD /D %SystemRoot%
MD Temp
::--------------------------------------
del /s /f /q c:\windows\temp\*.*
rd /s /q c:\windows\temp
md c:\windows\temp
del /s /f /q C:\WINDOWS\Prefetch
del /s /f /q %temp%\*.*
rd /s /q %temp%
md %temp%

Del /F /Q /S "%SystemRoot%\Prefetch\*.*" >nul
Del /F /Q /S "%SystemRoot%\Temp\*.*" >nul
RD /Q /S "%SystemRoot%\Temp" >nul
MD "%SystemRoot%\Temp" >nul
Del /F /Q /S "%UserProfile%\Local Settings\Temp\*.*" >nul
RD /Q /S "%UserProfile%\Local Settings\Temp" >nul
MD "%UserProfile%\Local Settings\Temp" >nul

Del /F /Q /S "%UserProfile%\Application Data\Adobe\Common\Media Cache Files\*.*" >nul

::--------------------------------------
:: Done!


Echo Done!
Echo Press Ctrl+C to abort or any other key to end . . .
Echo.
PAUSE > NUL
cls

EXIT





http://www.computerhope.com/msdos.htm

http://www.daniweb.com/forums/thread103247.html