一个批处理程序的小问题

来源:百度知道 编辑:UC知道 时间:2024/06/17 05:04:24
这时段批处理程序。结果直到了。后面的几个文件夹都指的系统里的那个位置?
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\*.*"

%userprofile% 是一个系统变量, 你可以
单击 开始 按钮, 运行 ,输入
%userprofile%
这样打开了什么文件夹, 它就指向了哪里了, 其它的那几个位置都是这个目录的子目录, 有 临时文件目录, 最近访问文档的快捷方式目录, COOKIES 目录.
%userprofile% 并不一定是指 C:\Documents and Settings\Administrator, 这要视装系统时的情况而定, 总之它就是指向一个当前用户的保存文档和设置的默认目录

echo 一下就知道了

@echo off
echo "%userprofile%\Local Settings\Temporary Internet Files\*.*"
pause

%userprofile%是指C:\Documents and Settings\Administrator