• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFExecute issue

New Here ,
Sep 15, 2007 Sep 15, 2007

Copy link to clipboard

Copied


I am having a problem with both cfexecute and CFX_EXEC in that they seem to launch an application as a process and work in the background, but I cannot get it to launch on the desktop as an application. This wouldn't be a problem as it actually seems to execute a single command very well. The problem I am having is when I try to launch a multi-step batch file or when I need to receive feedback from the launched application it fails.

I have a batch file which basically calls an application called imacros and depending on the outcome writes the results to mysql database. See attached code.

When I execute a batch file by double clicking it the CMD window opens and runs through the entire batch file perfectly. However when I execute the same batch file with cfexecute or cfx_exec the process only launches the first command, launching imacros and completes it's objective. However the process seems to terminate after that and thus nothing gets written to mysql.

I assume that this has to be a setting in Windows 2003 or a permissions issue that is not allowing me to run applications on the desktop. I have set Coldfusion to run as Administrator but this hasn't helped. I also have tried to assign it as System user and allow it to interact with desktop.
TOPICS
Advanced techniques

Views

484

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 17, 2007 Sep 17, 2007

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation