文档库 最新最全的文档下载
当前位置:文档库 › Win7磁盘清理批处理

Win7磁盘清理批处理

REM 清理垃圾文件并整理磁盘碎片,将后缀名改为bat或cmd

REM 部分命令仅适用于Windows 2003以上操作系统

@echo off

REM 用VBS实现批处理执行界面的隐藏,避免干扰其他程序
REM if "%1"=="h" goto begin
REM start mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin

REM 清理操作系统的垃圾文件
rd /s /q C:\Config.Msi
rd /s /q C:\MSOCache
rd /s /q %windir%\ie7updates
rd /s /q %windir%\ie8updates
del /q %windir%\MEMORY.DMP

echo 删除补丁备份目录
RD %windir%\$hf_mig$ /Q /S
echo 把补丁卸载文件夹的名字保存成2950800.txt
dir %windir%\$NtUninstall* /a:d /b >%windir%\2950800.txt
echo 从2950800.txt中读取文件夹列表并且删除文件夹
for /f %%i in (%windir%\2950800.txt) do rd %windir%\%%i /s /q
echo 删除2950800.txt
del %windir%\2950800.txt /f /q
echo 删除补丁安装记录内容(下面的del /f /s /q %systemdrive%\*.log已经包含删除此类文件)
del %windir%\KB*.log /f /q

echo 删除系统盘目录下临时文件
del /f /s /q %systemdrive%\*.tmp
echo 删除系统盘目录下临时文件
del /f /s /q %systemdrive%\*._mp
echo 删除系统盘目录下日志文件
del /f /s /q %systemdrive%\*.log
echo 删除系统盘目录下GID文件(属于临时文件,具体作用不详)
del /f /s /q %systemdrive%\*.gid
echo 删除系统目录下scandisk(磁盘扫描)留下的无用文件
del /f /s /q %systemdrive%\*.chk
echo 删除系统目录下old文件
del /f /s /q %systemdrive%\*.old
echo 删除回收站的无用文件
del /f /s /q %systemdrive%\recycled\*.*
echo 删除系统目录下备份文件
del /f /s /q %windir%\*.bak
echo 删除应用程序临时文件
del /f /s /q %windir%\prefetch\*.*
echo 删除系统维护等操作产生的临时文件
del /f /s /q %windir%\temp\*.*
rd /s /q %windir%\Temp & md %windir%\Temp

echo 删除当前用户的COOKIE(IE)
del /f /q %userprofile%\cookies\*.*
echo 删除internet临时文件
del /f /s /q "%userprofile%\local settings\temporary internet files\*.*"
echo 删除当前用户日常操作临时文件
del /f /s /q "%userprofile%\local settings\temp\*.*"
echo 删除访问记录(开始菜单中的文档里面的东西)
del /f /s /q "%userprofile%\recent\*.*"

del /f /s /q C:\Users\Administrator\AppData\Local\Temp
rd /s /q C:\Users\Administrator\AppData\Local\Temp
md C:\Users\Administrator\AppData\Local\Temp

REM 清理专用软件日志文件
forfiles /p "C:\WINDOWS" /s /m KB*.log /d -7 /c "cmd /c del @file"

REM 删除暴风影音缓存和影视库
del /f /s /q C:\StormMedia
rd /s /q C:\StormMedia
del /f /s /q "D:\My Documents\StormMedia"
rd /s /q "D:\My Documents\StormMedia"
del /f /s /q "D:\Download\StormMedia"
rd /s /q "D:\Download\StormMedia"
del /f /s /q "D:\Download\sp\StormMedia"
rd /s /q "D:\Download\sp\StormMedia"
del /f /s /q "D:\My Documents\暴风影视库"
rd /s /q "D:\My Documents\暴

风影视库"
del /f /s /q "D:\Download\暴风影视库"
rd /s /q "D:\Download\暴风影视库"
del /f /s /q "D:\Download\sp\暴风影视库"
rd /s /q "D:\Download\sp\暴风影视库"
del /f /s /q "C:\Users\Public\Desktop\暴风影视库.*"
del /f /s /q "C:\Users\Public\Desktop\暴风影音5.lnk"
del /f /s /q "C:\Users\Administrator\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\暴风影*.lnk"
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{36AAB89D-9FF5-4128-9BAE-B9867A245192}" /f
reg delete "HKEY_CLASSES_ROOT\CLSID\{36AAB89D-9FF5-4128-9BAE-B9867A245192}" /f
del /f /q "C:\Program Files (x86)\Baofeng\StormPlayer\MediaLibraryUpdate.exe"

REM 删除ACDSEE的缓存数据
del /f /s /q "C:\Users\Administrator\AppData\Local\ACD Systems\Catalogs\25Pro\Default\*.*"
del /f /s /q "C:\Users\Administrator\AppData\Local\ACD Systems\Catalogs\40Pro\Default\*.*"

REM 清理磁盘设置,首次运行时用,运行完,在下面一行前加上REM和空格将其注释掉
cleanmgr /sageset:99

REM 清理所有磁盘
cleanmgr /sagerun:99

REM 整理所有磁盘
defrag c: /f
defrag d: /f

相关文档
相关文档 最新文档