Assuming delims is required, the following result was found.
InitializingFile_456.csv -- the following loops through directory and separates by underscores FOR /F "tokens=2,3* delims=_" %%A IN ('DIR InitializingFile*') DO ECHO %%A -- yields: 123.csv 456.csv So that's our first loop, here's what the second loop...