This content has been marked as final. Show 5 replies
I ran into a similar problem recently. The two issues I had were that ffmpeg was timing out and I was unable to capture the error stream. What solved it for me was two excellent tips on cfexecute from Ben Forta's blog.
I wrote up an entry on it here
I am having the same problem, and I have tried the /c and the 2>&1 suggestions, but they haven't worked. I am trying to call an Exchange Management Shell cmdlet after loading the EMS extension into Powershell. Writing this code to a batch file and running that directly works. I've also tested that it's not a permissions issue. CF runs under a domain account in my setup so I was able to log in and run the batch file under the same account. Here are 2 versions of the cfexecute tag I've tried. I've also tried executing the batch file itself with the /c and the 2>&1 redirect. In all cases, the cfexecute times out leaving cmd.exe and/or powershell.exe running on the server.
Please help! Thanks!
I used /c and the 2>&1 fix were for a very specific issue: ffmpeg writes to stderr and cfexecute was not capturing the stderr stream. Though that issue was fixed in CF8 Update 1.
Not being familiar with Powershell, I do not know if your problem is caused by the same issue. I did see one article that mentioned a problem using Powershell with java's Runtime.exec().
I have not read it thoroughly, but you might try the suggestion of writing the output to a file, instead of a variable. Just to see if the process always hangs, or just when using the "variable" attribute.
cfexecute can be very unpredicatable. Your best bets are to a) try it using CF8.1, if it works great, 2) if not, or if you don't have access to CF8.1, trying writing it directly through a Java object using CF's built-in native Java support and CFSCRIPT. There are some pretty good resources out there if you Google it (they are too specific to mention any single solution here).
I happen to come across this post while researching how to capture a "success" message once cfexecute is finished (I'm using CF8.1). I think the Java route is the best for this because you can get very granual control over the messages.
Thanks very much for your response. I meant to post again a few days ago, when I was able to use suggestions from the link that CFSearching posted on 6/17 (thanks very much CFSearching!) to write my own Java object and call that instead of CFExecute (specifically the comment about proc.getOutputStream().close(); did the trick). Thanks everyone.