我们的电脑使用时间久了都会产生很多的垃圾,有些win7系统用户想要在不使用其他软件的前提下,来清理电脑中的垃圾,我们可以通过代码的方式来进行操作,为了方便大伙操作使用,本期的win7教程就来和大伙分享详细的解决步骤,一起来看看具体的操作步骤吧。
win7代码清理垃圾操作教程
1、首先使用快捷键“win+R”打开运行窗口。
2、输入命令“cleanmgr”,回车确定打开清理窗口。
![win7系统如何通过代码清理垃圾?win7代码清理垃圾操作教程](https://www.zmtpc.com/d/file/p/2024/06-17/9823628a125e47fb853c0253c4646efe.png)
3、选择想要扫描清理的磁盘,单击“确定”即可运行。
![win7系统如何通过代码清理垃圾?win7代码清理垃圾操作教程](https://www.zmtpc.com/d/file/p/2024/06-17/15334aeca591764d97bce93182082567.png)
4、等待扫描完成。
![win7系统如何通过代码清理垃圾?win7代码清理垃圾操作教程](https://www.zmtpc.com/d/file/p/2024/06-17/b8deb1e24465d2b99db665590b82239f.png)
5、弹出窗口中选择你想要清理的文件,单击下方“清理系统文件”即可清理完成。
![win7系统如何通过代码清理垃圾?win7代码清理垃圾操作教程](https://www.zmtpc.com/d/file/p/2024/06-17/d113e6136ec51b85192aca2537b84765.png)
6、右键桌面鼠标滑动到“新建”,单击选择“文本文档”。
![win7系统如何通过代码清理垃圾?win7代码清理垃圾操作教程](https://www.zmtpc.com/d/file/p/2024/06-17/58f09b2d8f212a4f86edfad988d9b5a3.png)
7、打开记事本文本文档,粘贴以下命令,单击左上角“文件”,选择另存为,并修改名字为“一键清理.bat”:
@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 清除系统LJ完成!
echo. & pause
![win7系统如何通过代码清理垃圾?win7代码清理垃圾操作教程](https://www.zmtpc.com/d/file/p/2024/06-17/68fe6a504bebb7c7c731da8a3024ecb9.png)
8、双击运行win7桌面上的“一键清理.bat”,等待其清理垃圾文件完成即可。
![win7系统如何通过代码清理垃圾?win7代码清理垃圾操作教程](https://www.zmtpc.com/d/file/p/2024/06-17/d850cd01219553c1085c43be3efea6b2.png)