第一步桌面创建一个txt文档,然后把下面的代码复制粘贴到文档里,文件名随意
@echo off
echo waiting......
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 success!
echo. & pause
形如下图
然后保存,把文件后缀.txt改成.bat 如果电脑没有显示后缀如何设置的下面简单提下
拿win11举个例子(win10同理 进去找查看)
点开我的电脑(也可能叫 此电脑)
勾选即可
改完以后是这样的
然后双击
出现请按任意键继续 就可以关闭窗口了
(执行过程中出现乱码可以不用理会)