In general, environment variable syntax is only recognised by shells and shell interfaces, not by applications, so this behaviour is consistent across all programs, by Dyalog and others.
The %name% syntax is specific to the Windows/DOS shells, while UX shells use $NAME, or ${NAME} if the name has unusual characters in it. SALT uses [name], but user commands in general don't support this. In any case, such a syntax might need a way to escape it if the literal characters are needed.
The formal way to achieve what you wrote is:
⎕SE.UCMD'CD ',⎕SE.Dyalog.Utils.Config'cas'
A couple of notes are in order:
- Changing directory while code is running can have unexpected consequences.
- It is considered bad practice to use user commands under program control.
Still, should you want to do this on a regular basis, you can roll your own user command pre-processor,
'\[[^]]+]'⎕R{⎕SE.Dyalog.Utils.Config 1↓¯1↓⍵.Match}
which replaces text in square brackets with the corresponding environment variable.