Quote:

Already tried.
$cmd contains %qlserver%\store\calc.exe but does not execute within the shell-command.




Did you try to run under %COMSPEC%? You will need to do this if you want to expand environment variables on the command line.

You also need to ensure that the environment variable is available - it depends on how you set it.

You will also need to protect the command path if it contains spaces.

Your SHELL command should look like this:
Code:
Shell '"'+%COMSPEC%+'" /C "'+$cmd+'"'

If @ERROR "Got error in SHELL: ["+@ERROR+"] "+@SERROR+@CRLF EndIf