It is very unlikely that this is a desktop problem. You can
easily verify that in CFX_EXEC using INTERACTIVE option.
Most likely this is the problem with conditions in your batch
file, which are not correctly processed due to using "alien"
launchers (CFEXECUTE and CFX_EXEC).
Immediate suggestion is not to use the batch file at all, but
use conditional CFX_EXEC. CFX_EXEC returns the process return code,
which you might be able to use for recognizing the error condition,
if "imacros.exe" sets it properly. So, just analyze process return
code and launch second CFX_EXEC or CFXEXECUTE to run the
appropriate second command.