Skip to main content
Participant
April 10, 2014
Answered

Problem with CFExecute...

  • April 10, 2014
  • 2 replies
  • 1413 views

I am trying to use cfexecute to run a video conversion application. The application is installed at:

C:\Program Files\SourceTec\vee\vee.exe

The video I want to convert is stored in the temp directory as returned by GetTempDirectory() which in this case is:

C:\ColdFusion9\runtime\servers\coldfusion\SERVER-INF\temp\wwwroot-tmp\

I've tried a wide range of different ways to call this program and whenever it seems like I'm getting close, I get the following error:

Error: Failed to open the source file "C:\ColdFusion9\runtime\bin\vee".

I don't have any files in that directory and am not attempting to access it explicitly but ColdFusion keeps trying to find something in that directory and I don't understand why.

The following code works:

<cfexecute name="C:\Program Files\SourceTec\vee\vee.exe" arguments="vee -v" timeout="300" variable="results"></cfexecute>

...but all it does is display the version number of the video encoder engine: Version: 3.2 (Build 322)

When running this code:

<cfexecute name="C:\Program Files\SourceTec\vee\vee.exe" arguments="vee #GetTempDirectory()#test.avi -i" timeout="300" variable="results" ></cfexecute>

...It should look at the test.avi file in the temp directory and return info about it (-i). Instead, I get the error I mentioned above:

Error: Failed to open the source file "C:\ColdFusion9\runtime\bin\vee".

Why is CF looking in C:\ColdFusion9\runtime\bin\vee for a source file?

This topic has been closed for replies.
Correct answer BKBK

Why another 'vee' as argument? I expected something like

<cfset moviePath = GetTempDirectory() & "test.avi">

<cfexecute name="C:\Program Files\SourceTec\vee\vee.exe"

arguments="#moviePath# -i" timeout="300" variable="results" ></cfexecute>

2 replies

BKBK
Community Expert
BKBKCommunity ExpertCorrect answer
Community Expert
April 11, 2014

Why another 'vee' as argument? I expected something like

<cfset moviePath = GetTempDirectory() & "test.avi">

<cfexecute name="C:\Program Files\SourceTec\vee\vee.exe"

arguments="#moviePath# -i" timeout="300" variable="results" ></cfexecute>

Carl Von Stetten
Legend
April 11, 2014

BKBK wrote:

Why another 'vee' as argument? I expected something like

<cfset moviePath = GetTempDirectory() & "test.avi">

<cfexecute name="C:\Program Files\SourceTec\vee\vee.exe"

arguments="#moviePath# -i" timeout="300" variable="results" ></cfexecute>

Was wondering that myself...

Carl Von Stetten
Legend
April 10, 2014

I don't know if this is your issue, but I've had problems with passing paths with spaces in them.  They need to get wrapped in quotes when passed to the command line, and <cfexecute> doesn't do that by default.  Try changing this:

<cfexecute name="C:\Program Files\SourceTec\vee\vee.exe"

to this:

<cfexecute name="""C:\Program Files\SourceTec\vee\vee.exe"""

Note that there are a total of three double-quotes before and after the path to the executable.  The outermost are your original name argument quotes, the inner two send an escaped set of quotes into the command line.

HTH,

-Carl V.

Participant
April 10, 2014

Thanks Carl. That is a good tip but sadly it did not resolve the issue. I'm still getting the same error.

Carl Von Stetten
Legend
April 10, 2014

Try escaping the arguments= part the same way.

-Carl V.