Copy link to clipboard
Copied
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?
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>
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thanks Carl. That is a good tip but sadly it did not resolve the issue. I'm still getting the same error.
Copy link to clipboard
Copied
Try escaping the arguments= part the same way.
-Carl V.
Copy link to clipboard
Copied
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>
Copy link to clipboard
Copied
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...
Copy link to clipboard
Copied
I think that was it. Thanks so much. I am now able to get the video info. I still can't do a successful conversion but I don't think it is related to CFExecute. Thank you guys! I really appreciate it.