如何做到关机时自动删除temp文件夹下的文件

来源:百度知道 编辑:UC知道 时间:2024/06/06 13:28:47
比如c:\documents and settings\admin\local settings\temp\
下面的..等..
尽量c盘下所有的

自动我就不知道了,便把下面的代码做成一个批处理文件,可以方便的手动清除系统垃圾,包括你所说的东东。

做批处理的方法:
1.打开系统自带的记事本软件;
2.把下面的代码拷进去;
3.保存为扩展名为.bat的文件。
4.OK,双击即可运行。

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