\AppData\Roaming\Garmin\ConnectIQ\current-sdk.cfg) was unexpected at this time

Former Member
Former Member

I'm following this link to set up Connect IQ, such as installing SDK, etc. I have completed all the previous steps. Now, I'm using the command prompt (administrator) to type: 

> for /f usebackq %i in (%APPDATA%\Garmin\ConnectIQ\current-sdk.cfg) do set CIQ_HOME=%~pi
> set PATH=%PATH%;%CIQ_HOME%\bin

However, after I type the 1st line, the return message is: 

\AppData\Roaming\Garmin\ConnectIQ\current-sdk.cfg) was unexpected at this time.

Any idea, please? 

Thanks! 

  • Does your username have a space in it? If so, try this instead:

    for /f  "usebackq delims=" %i in ("%APPDATA%\Garmin\ConnectIQ\current-sdk.cfg") do set CIQ_HOME=%~pi

    I suspect your problem is different, though. (If your username had spaces I would expect to see a "file not found" error.)

    I think you can get away without this step, as I've never done it. I think it's just a convenience step for you to be able to easily use the compiler and other tools from the command line.

    If this doesn't, what happens what you type this command?

    type "%APPDATA%\Garmin\ConnectIQ\current-sdk.cfg"

    You should see something similar to:

    C:\Users\YOURUSERNAME\AppData\Roaming\Garmin\ConnectIQ\Sdks\connectiq-sdk-win-3.2.5-2021-02-12-6d31f4357\

    (Also, not to state the obvious, but you don't type the leading ">" -- I'm sure you knew that tho.)

  • That command should be

    for /f "usebackq delims=" %i in ("%APPDATA%\Garmin\ConnectIQ\current-sdk.cfg") do set CIQ_HOME=%~dpi

    Note that I'm using %~dpi instead of %~pi. This includes the drive letter in the resulting path.