代码详解,高手进。!

来源:百度知道 编辑:UC知道 时间:2024/05/18 10:11:23
这个是清理系统的代码,
哪个高手可以解释下每句代码是什么意思吗?
什么用途,是什么原理。
代码:
@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

/f 表示强制删除,不管是不是只读
/s 表示从子目录删除
/q 表不再询问,直接删除
%systemdrive% 表示Windows系统驱动的安装目录。一般是C:\winnt\system32\drives 或c:\windows\system32\drives

%windir%\ 表示Windows系统目录,一般是C:\winnt 或c:\windows
%userprofile% 表示个设置目录,是C:\Documents and Settings\用户名

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 &quo