Originally posted by qzwqzw at 2008-6-25 21:55:
可以考虑分别不用strings
分别用
dir /s/b %0
和
for %%p in (%path%) do dir /b %%p.\%0
探测
应该能得到绝大数情况下的批处理所在路径
至于如果将标准输出 ...
我们上面讨论中考虑的特殊情况就是批处理既不在搜索路径中,也不在当前盘上的情况,你的方案正好无法解决所有这些特殊情况。
Originally posted by qzwqzw at 2008-6-25 21:55:
Can consider not using strings respectively
Use respectively
dir /s/b %0
and
for %%p in (%path%) do dir /b %%p.\%0
Detect
Most cases where the batch processing is located in the path can be obtained
As for if the standard output ...
The special case we discussed above is that the batch processing is neither in the search path nor on the current disk. Your solution just can't solve all these special cases.