It seems that there are conditional restrictions when expanding the path with %%~fi. The code of 12F can indeed accurately get the real absolute path, but this absolute path is obtained by dir, not by expanding with %%~fi. Changing set Name=%%~fa to set Name=%%a has the same effect.
However, the code of 12F has a flaw: when there are files with the same name in different folders, when dir is used again to query, it can only get the file with the same name in one of the directories, not all; I don't understand the purpose of find /v "sequence". Suppose a file name or path name contains the word "sequence", then it will be filtered out?
In addition, in the example of 15F, the format of ^|findstr ".mmf" will find all files whose file names contain mmf, not just files whose suffix is .mmf, because findstr supports regular expressions, and the dot matches any character in the regular expression.
Considering the advantages and disadvantages of various schemes, I think only the method of generating temporary files may be able to meet the requirements of the owner.
[ Last edited by namejm on 2006-11-8 at 08:21 PM ]
However, the code of 12F has a flaw: when there are files with the same name in different folders, when dir is used again to query, it can only get the file with the same name in one of the directories, not all; I don't understand the purpose of find /v "sequence". Suppose a file name or path name contains the word "sequence", then it will be filtered out?
In addition, in the example of 15F, the format of ^|findstr ".mmf" will find all files whose file names contain mmf, not just files whose suffix is .mmf, because findstr supports regular expressions, and the dot matches any character in the regular expression.
Considering the advantages and disadvantages of various schemes, I think only the method of generating temporary files may be able to meet the requirements of the owner.
[ Last edited by namejm on 2006-11-8 at 08:21 PM ]
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
考虑问题复杂化,解决问题简洁化。
