views:

155

answers:

3

I have no experience with ColdFusion, but I'd like to find out if it's possible to call a windows .exe file from a ColdFusion app (assuming the app and the .exe are running on the same machine) and then use the response from the .exe to pass to another method in the ColdFusion app (or for simplicity's sake just display the response in an alert window).

+10  A: 

You can run exe's by using cfexecute.

http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_d-e_18.html

You can store the output from the exe into a variable and then pass that to another programme using another cfexecute.

Bigfellahull
+1  A: 

cfexecute is pretty limited. For instance it does not output any error text.

An alternative is to use the JAVA runtime exec method. Here is some more comprehensive information of it's use in regard to Coldfusion.

http://blog.stannard.net.au/2007/9/21/executing-system-commands-with-coldfusion/

It can be tricky though.

Tyler Clendenin
If you mean the stderr stream, that was added in one of the CF8 updates. Prior to that, you can capture it by doing a redirect http://www.forta.com/blog/index.cfm/2006/9/11/A-Couple-Of-CFEXECUTE-Gotchas
Leigh
A: 

Hi -

Can anyone help me with an alternative to cfexecute?

I'm using ImageMagick to upload and resize images for use on a site. The current code looks like this at the point where it tries to execute the exe, but the hosting company do not allow cfexecute:

<cfexecute name="#pathToImageMagick##executableFile#" arguments="#actionString#" timeout="#timeout#"></cfexecute>

Is there a way around this?

Thanks

Dan
try asking this as its own question and not as an answer to another question... you'll probably get more responses!
marc esher