网络运营 > 服务器 > Windows

阿里云服务器windows系统C盘一键清理脚本

67人参与2021-07-30

@echo off
@echo
@echo
@echo 清理几个比较多垃圾文件的地方
del /f /s /q "c:\windows\pchealth\errorrep\qsignoff\*.*"
del /f /s /q "c:\windows\pchealth\errorrep\userdumps\*.*"
del /f /s /q "c:\windows\system32\logfiles\httperr\*.*"
del /f /s /q "c:\windows\microsoft.net\framework\v2.0.50727\temporary asp.net files\*.*"
del /f /s /q "c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\*.*"
del /f /s /q "c:\windows\temp\*.*"
del /f /s /q /a:s "c:\windows\iis temporary compressed files\*.*"

@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\*.*

@echo 删除当前用户的cookie(ie)
del /f /s /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\*.*"

http://www.kejianet.cn/c-clean/

您对本文有任何疑问!!点此进行留言回复

推荐阅读

猜你喜欢

服务器安全设置之 系统服务篇

04-18

IIS7.5 配置自定义后缀的ASP文件 无法执行 总是提示下载的解决方法

04-17

IIS安全设置图文教程

06-01

IIS监控请求脚本分享

04-19

Windows Server 2016 PHP运行环境安装配置

05-28

Win2003 IIS浏览ASP提示无法找到该页的解决办法

05-31

win2003+IIS服务器下运行ASP+ACCESS非常慢的解决方法

04-18

配置win2008防火墙 允许被Ping的设置方法

06-01

热门评论