When I try to run this command.

This command finds a line of code that contains 213 and put it into a variable.

for /f "delims=" %a in ('findstr /R /I 213 N:\****\*****\DateMod_SBDM.txt') do @set sbdmcurdate=%a

In a .bat file it says.

\****\*****\DateMod_SBDM.txt') was unexpected at this time.

However it works when entered into the command line manually.
Maybe its a problem with the syntax but I'm pretty sure its correct.
Please help.

Just figured it out.
Needed a double % sign for the variables. And no @ sign infront of set
So the new code would be.

for /f "delims=" %%a in ('findstr /R /I 213 N:\****\*****\DateMod_SBDM.txt') do set sbdmcurdate=%%a