标题: [已解决]怎么用批处理得到指定文件的路径?
[打印本页]
作者: YunEr
时间: 2007-10-20 10:50
标题: [已解决]怎么用批处理得到指定文件的路径?
比如,我知道wget.txt的目录在C:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files\,然后用dir /s wget.txt,但是怎么样得到这个wget.txt的真实路径呢?
我得到了真实路径,就可以把他复制到其他盘里面了!
如下图:我在cmd里面的命令输出.
C:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files\
Content.IE5>dir /s wget.txt
驱动器 C 中的卷没有标签。
卷的序列号是 2038-E082
C:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files
\Content.IE5\I9O7CNEB 的目录
2007-10-18 17:54 774,731 wget.txt
1 个文件 774,731 字节
所列文件总数:
1 个文件 774,731 字节
0 个目录 7,420,198,912 可用字节
Last edited by YunEr on 2007-10-20 at 11:18 AM ]
作者: YunEr
时间: 2007-10-20 11:17
哈哈。自己弄好了。
for /d /r %%a in (*) do (
if exist "%%a\wget[1].txt" set wget=%%a
)
copy "%wget%\wget[1].txt" C:\wget.txt