自作清理系统垃圾怎么清理完自动退出

发布时间:2024-05-10 06:40 发布:上海旅游网

问题描述:

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

sfc /purgecache '清理系统盘无用文件

defrag %systemdrive% -b '优化预读信息

echo 清除系统垃圾完成!

echo. & pause
我的意思是自动退出 不要按任意键才退出
谢谢你们的回答 如果不行就算了 不要在我这浪费宝贵时间

问题解答:

把结尾的echo. & pause去掉就行了,
pause在批处理(CMD)里面的意思是暂停里面的内容,按任意键继续。
pause>nul为不显示“按任意键继续”这句话。。。。。

@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

文件名为"清楚系统LJ.bat"

清理系统垃圾,都用360安全卫士。
体检一下就行了很方便,还可以检测电脑是否安全。
http://down.360safe.com/setup.exe

@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 清理系统垃圾完成!
echo. & pause

把以上拷到一个新建txt文本中,保存为***.bat(***自己取),保存类型为所有文件,编码为ANSI。就OK了。不想删除cookies(有些网页登陆时记住密码,需要cookie)就把“del /f /q %userprofile%\cookies\*.* ”去掉。

无法自动退出,只能麻烦点按一下了。

按任意键
补充:这个貌似不行

热点新闻