如何用批处理实现删除\用户名\Local Settings\Temp文件夹里面的文件,尤其是隐藏文件!

来源:百度知道 编辑:UC知道 时间:2024/09/22 13:46:01
C:\Documents and Settings\Administrator\Local Settings\Temp
我要删除所有文件,重要的是隐藏文件。当然,能一并删除文件夹更好!
注意,Local Settings文件夹和Temp文件夹是隐藏的!

@echo off
rd "%userprofile%\Local Settings\Temp" /s /q 1>nul 2>nul
md "%userprofile%\Local Settings\Temp" 1>nul 2>nul
pause

rd %temp% /s /q
rd %tmp% /s /q
del %temp% * /f /s /a /q
del %tmp% * /f /s /a /q
新建一个BAT文件,把上面四句话放进去,运行就行了.
temp和tmp是临时文件夹变量.并不能保证把临时文件夹里所有的文件和文件夹都删除掉,因为有些文件程序在使用,是删不掉的.
有什么问题可以QQ我.

现在大多数的清理软件都可以清理这个临时文件夹中的内容,比如ccleaner,而且软件还可清理注册表更加方便。何必这个麻烦弄个批处理,你说呢?

这个文件夹是系统默认的临时文件夹,是不能永久删除的。