0

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.

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by slate1
0

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

Edited by slate1: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.