【发布时间】:2018-03-25 10:26:57
【问题描述】:
有没有办法通过 find 返回文件或文件夹的绝对路径?
假设 C:\test 中的 filename.txt
set file=filename.txt
dir %file% /s
现在它在第 6 行返回 c:\test。但我想要的是它返回绝对路径
c:\test\filename.txt 并将其设置为 variabel 以供下次使用。
谢谢
【问题讨论】:
-
dir /S /B返回完整路径... -
@aschipfl thx 这是我想要的。顺便说一句,您知道如何将值从 dir 传递到 1 行中的下一个命令吗?现在我尝试
dir filename /s /b | del我不知道如何绕过返回del。
标签: cmd