user3683638
user3683638

Reputation: 25

when using for /f - "was unexpected at this time"

I have the following code in a batch file named test.bat:

SET TEMP_PATH=%1%
for /f "tokens=1,2 delims=:" %%a in {%TEMP_PATH%"} do set PATH=%%a &set REVISION=%%b

when calling in cmd test.bat somelongstring:123456

I get:

{somelongstring:123456"} do set PATH=%a &set REVISION=%b was unexpected at this time.

Can anyone tell me why I am getting this error? Thanks in advance!

Upvotes: 0

Views: 983

Answers (1)

Stephan
Stephan

Reputation: 56180

use (, ) instead of {, }.

{,} are not proper syntax for for

Upvotes: 2

Related Questions