电脑C盘清理

发布时间 2023-11-06 09:48:00作者: 付时凡

Windows电脑用久了之后,总是会产生很多“垃圾”,例如临时文件/日志/缓存等。 如果硬件参数很强,自然不用担心,但多数电脑,在使用一段时间后,都会慢慢“占据”C盘,导致电脑卡顿,使用体验不佳。 这里共享一份清理电脑C盘的脚本。

源码如下:

@echo off

echo 正在清理系统垃圾文件,请稍等......
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
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
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo 清理系统垃圾完成!

复制后,保存为clean.bat文件,用鼠标左键选中后,再右键“以管理员运行”,可达到清理C盘的目的。