You need to specify several args to exec
, not a single arg. You want
exec -- c:/bin/setcfg.exe bobat.cfg inserter.${project}.Method $method
Sometimes, you'll see code that constructs the command as a list. In that case, you will use the "splat" operator to expand the list into individual elements.
set command [list c:/bin/setcfg.exe bobat.cfg inserter.${project}.Method $method]
exec -- {*}$command
See the exec man page and the Tcl syntax page