windows系统代码

来源:百度知道 编辑:UC知道 时间:2024/09/25 21:13:24
我计算机的速度慢,今天上网查了下如何加快系统速度,查到如下一段代码
@echo off
echo 正在清除系统垃圾文件,请稍等......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.gif
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
那人说把上面的代码写入txt文档,另存为.bat文件。然后

@echo off //关闭命令行的显示,前面的@是不显示本行命令
echo 正在清除系统垃圾文件,请稍等...... //显示“正在清除系统垃圾文件,请稍等...... ”
del /f /s /q //del是DOS或windows命令提示符的内部命令,作用是删除文件。参数f是强制删除只读文件;参数s是从所有子目录删除指定文件;参数q是安静模式,删除全局通配符时,不要求确认。
del命令后面的就是文件路径和文件名,其中%括起来的是windows的环境变量:
%systemdrive%代表windows所在磁盘分区的根目录,一般是c:\;
%windir%代表windows目录,一般是c:\windows\;
%userprofile%代表当前用户的配置文件所在的目录,一般是c:\Documents and Settings\下的以用户名为名称的目录。

我们平常上网会有些系统缓存,让我们下次访问的时候能够更快的访问上次的网站。
主要是删除这里面的信息
C:\Documents and Settings\aaa\Local Settings\Temporary Internet Files
让电脑的资源节约出来
里面的LOCAL 是隐藏文件夹