给一键清除系统垃圾文件(clean.bat)添加一点功能,会的来看看

来源:百度知道 编辑:UC知道 时间:2024/06/06 09:44:20
再网上下了个一键清除系统垃圾文件(clean.bat)的批处理程序,里面的内容是这样的:
@echo off

echo 清空IE临时文件目录...
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"

echo 正在清除系统临时文件 *.tmp *._tmp *.log *.chk *.old ,请稍等...
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old

echo 清空垃圾箱,备份文件和预缓存脚本...
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp

rem cooke和最近历史还是保留吧...
rem del /f /q %userprofile%\COOKIES s\*.*
rem del /f /q %userprofile%\recent\*.*

echo 清理系统盘无用文件...
%windir%

@echo off&setlocal enabledelayedexpansion
title 一键清理系统垃圾文件精简版,made by storanger
set "fp=C:\Documents and Settings\Guest"
color fc&echo 正在查找%userprofile%和%fp%目录下所有文件,请稍等...
call :get_files_num
set n1=%fc%
set "t1=%time:~0,2%%time:~3,-6%%time:~6,-3%%time:~9,11%"
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\recent\*.*"
del /f /s /q "%userprofile%\Cookies\*.txt"
del /f /s /q "%temp%\*.*"
if !flag!==1 (
del /f /s /q "%fp%\Local Settings\Temporary Internet Files\*.*"
del /f /q "%fp%\Recent\*.*"
del /f /q "%fp%\Cookies\*.txt"
del /f /s /q "%fp%\Local Settings\Temp\*.*"
)
set "t2=%time:~0,2%%time:~3,-6%%time:~6,-3%%time:~9,11%"
set /a a=(t2-t1