众所周知,电脑在使用过程中会产生大量的临时文件,这些文件长期累积会对电脑的运行效率产生影响。我们需要定期清理系统中的垃圾。如果一个个手动清理会显得非常繁琐,其实我们可以通过创建一个批处理.bat文件来实现小火箭节点购买便捷清理。每次需要清理时,只需双击该文件即可快速完成。接下来,以Windows 7 64位纯净版系统为例,说明如何使用批处理文件来快速清理系统垃圾。
具体操作步骤如下:
1、右键点击鼠标,选择“新建”,然后选择“文本文档”。
2、将文本文档的文件名改为“win7一键清除垃圾.bat”,记得去掉后面的.txt后缀。修改文件后缀名时,系统会弹出提示,点击“是”确认。
3、找到“win7一键清除垃圾.bat”文件,右击并选择“编辑”。
4、在打开的文件中输入以下内容:
@echo off
color 0a
title Windows 7 系统垃圾清理---
echo ★☆ ★☆ ★☆ ★☆ ★☆★☆★☆ ★☆ ★☆ ★☆ ★☆★
echo ★☆ ★☆ ★☆ ★☆ ★☆★☆★☆ ★☆ ★☆ ★☆ ★☆★
echo.★☆ ☆★
echo.★☆ ☆★
echo.★☆ 正在清理系统垃圾文件,请稍等...... ☆★
echo ★☆ ☆★
echo.★☆ ☆★
echo ★☆ ★☆ ★☆ ★☆ ★☆★☆★☆ ★☆ ★☆ ★☆ ★☆★
echo ★☆ ★☆ ★☆ ★☆ ★☆★☆★☆ ★☆ ★☆ ★☆ ★☆★
echo 垃圾文件清理中,速度将根据电脑文件大小而有所不同。在未看到结束信息之前
echo 请勿关闭此窗口。
echo 正在清除系统垃圾文件,请稍候......
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% ecycled*.*
echo 删除系统目录下备份文件
del /f /s /q %windir%*.bak
echo 删除应用程序临时文件
del /f /s /q %windir%prefetch*.*
echo 删除系统维护等操作产生的临时文件
rd /s /q %windir% emp & md %windir% emp
echo 删除当前用户的COOKIE(IE)
del /f /q %userprofile%cookies*.*
echo 删除internet临时文件
del /f /s /q "%userprofile%local settings emporary internet files*.*"
echo 删除当前用户日常操作临时文件
delete /force /s /quiet "%userprofile%local settings emp*.*"
echo Deleting browsing history (things in the documents in the start menu)
delete /force /s /quiet "%userprofile% ecent*.*"
echo
echo ★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
echo ★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
echo ★☆ ☆★
echo.★☆ ☆★
echo.★☆ ☆★
echo ★☆ ☆★
echo ★☆ Congratulations! All cleanups completed! ☆★
echo.★☆ ☆★
echo ★☆ ☆★
echo.★☆ ☆★
echo ★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
echo ★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
echo.
Then click on File and choose Save
5 Double-click on the "win7 one-click junk clean-up.bat" file to start running
6 Wait for the file to finish running, and the system junk files will be cleaned up. After cleaning, the "win7 one-click junk clean-up.bat" will automatically close.
The above is the detailed creation method of win7 system junk clean-up bat explained to everyone. Users who need it can follow the above steps to operate, you can give it a try.