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

Problem with CFExecute...

New Here ,
Apr 10, 2014 Apr 10, 2014

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?

Views

1.2K

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

correct answers 1 Correct answer

Community Expert , Apr 11, 2014 Apr 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>

Votes

Translate

Translate
Guide ,
Apr 10, 2014 Apr 10, 2014

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.

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
New Here ,
Apr 10, 2014 Apr 10, 2014

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.

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
Guide ,
Apr 10, 2014 Apr 10, 2014

Copy link to clipboard

Copied

Try escaping the arguments= part the same way.

-Carl V.

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
Community Expert ,
Apr 11, 2014 Apr 11, 2014

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>

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
Guide ,
Apr 11, 2014 Apr 11, 2014

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

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
New Here ,
Apr 14, 2014 Apr 14, 2014

Copy link to clipboard

Copied

LATEST

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.

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