如何根据cmd中的路径变量扩展到完整路径文件名


0

正如我所想,变量expand命令:

%~dp$PATH:I

用于迭代路径 %path% 变量并查找包含变量指定的文件名的第一个匹配项 %I,然后扩大 %I 到完整路径文件名。
这正是我想要做的事情 .bat 文件,所以我尝试了这个命令并失败了。

我错了这个命令的意思吗?或者只是我做错了?


1
“我对这个命令的含义是错误的吗?”是。你究竟想做什么?
DavidPostill

%~$PATH:I 作品 从某种意义上说 类似于 where 命令。例如,比较命令 for %I in (help) do @echo %I: %~$PATH:Ifor %I in (help) do @where %I。读 where /?call /? 作出解释。
JosefZ
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.