Can someone please explain what is wrong with my for statement? I'm trying to run it as a bat file. I've looked at various examples online and I can't seem to figure out why I get a syntax error
FOR /F "tokens=*" %%A in (c:\scripts\destination.txt) DO
(
echo inside the for loop
pause
)
I get the following error:
The syntax of the command is incorrect. C:\Scripts>FOR /F "tokens=*" %A in (c:\scripts\destination.txt) DO
The parenthesis has to be on the same line.
tokens=* removes leading whitespace - the delims= doesn't.
FOR /F "delims=" %%A in (c:\scripts\destination.txt) DO (
echo %%A - inside the for loop
pause
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With