
I'm trying to read a .js file which contains version information at the end of a particular line. The extract below from a batch script should find the line containing the version information and store it in a variable called Version which I should be able to extract the version from.
The problem is that the string that gets passed to %%a is truncated at the first closing bracket it finds which is before the version information I need. I'm pretty sure the script is interpreting the bracket as an end of string or end of command character even though I've set delims to be just semicolons. %%b would return me the next bit and so on but the .JS script changes frequently and the verison info may be in a different position each time.
Has anyone got any suggestions on how to stop this from happening as it is winding me up! It would be nice if I could tell "Find" to ditch everything before the found search string but I guess it can only return the entire line....bring back grep!!!

for /F "tokens=1* delims=;" %%a in ('findstr /I /C:"xyz\.versions={" "!ProductPath!\!Product!.js"') do (
if not ERRORLEVEL 1 (
set Version=%%a
echo.%%a
rem some truncation logic on "Version" to extract the actual version string
)
)