You are missing the opening parenthesis of the
ELSE
clause. You have:
) else
It should be:
) else (
[EDIT]
Your if statements are not correct, you have the following:
if "!line!" == "!versionVar!=!versionVal!" set <-- THIS IS INCORRECT
line=!versionVar!=!var!.!string! <-- THE IF PART IS NOT CLOSED
echo(!line!>>!file!)
) else <-- THE ELSE CLAUSE IS NOT OPENED
set "line=%%~j"
if "!line!" == "!versionVar!=!versionVal!" set line=!versionVar!=!versionVar!=!versionVal!
echo !line!>>!file!)
)
Try this:
if "!line!" == "!versionVar!=!versionVal!" (
set line=!versionVar!=!var!.!string!
echo(!line!>>!file!)
) else (
set "line=%%~j"
if "!line!" == "!versionVar!=!versionVal!" (
set line=!versionVar!=!versionVar!=!versionVal!
echo !line!>>!file!
)
)
And try using consistent and proper indentation so your code is readable.
[/EDIT]