Wrong problem statement.

Limiting yourself to a .bat file complicates things. A language like vbscript or wcript supports substrings.
http://www.pctools.com/guides/scripting/ might be useful.

Kees