If defined %~1 for /f 'delims=:' %%N in ( Here is a new algorithm that uses the FINDSTR /O option: off
(Actually there are a few additional optimizations bandied about on DosTips, but I don’t think they are worth it)īut it is fun to come up with new efficient algorithms.
I prefer jeb’s accepted answer – it is the fastest known solution and the one I use in my own scripts.