多语言展示
当前在线:1293今日阅读:84今日分享:32

如何用代码清理垃圾

当不喜欢用安全卫士、安全管家之类的软件时,又想清理垃圾,我们可以用代码自己制作清理C盘的小小的bat。不仅小巧灵活、简单容易制作、不占内存、有一定清理缓存垃圾的效果。
工具/原料

记事本

方法/步骤
1

右击桌面,新建一个文本文档。

2

复制下面的代码到文本文档。推荐复制,不要自己打。@echo offecho 正在清除系统垃圾文件,请稍等......del /f /s /q %systemdrive%\*.tmpdel /f /s /q %systemdrive%\*._mpdel /f /s /q %systemdrive%\*.logdel /f /s /q %systemdrive%\*.giddel /f /s /q %systemdrive%\*.chkdel /f /s /q %systemdrive%\*.olddel /f /s /q %systemdrive%\recycled\*.*del /f /s /q %windir%\*.bakdel /f /s /q %windir%\prefetch\*.*rd /s /q %windir%\temp & md %windir%\tempdel /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以上为复制内容:del /f /q %userprofile%\cookies\*.*这一行为清理表单及登录密码如果不想清理可以删掉。

3

菜单栏“文件”选择另存为。

4

先选择桌面,文件名为“清理垃圾LJ.bat',保存类型为:”所有文件“。

5

制作完成之后,就是这样。

6

双击打开,开始清理垃圾。

7

清理之后按任意键结束清理。

注意事项

文件名的后缀为.bat

推荐信息