Skip to main content
Participant
February 20, 2012
Question

CFEXECUTE / vlc

  • February 20, 2012
  • 1 reply
  • 2489 views

I have searched (and searched, and searched) and I cannot figure out what's going on here.  I've ready 1,392 different pages about how easy cfexecute is and yet nothing I do seems to work.

Here's what I am trying to accomplish;

I have an HTPC setup with all my movies on it.  It's Windows 7, I have CF9 Developer installed and running.  I have created a very simple web-app (only running locally on the HTPC) and I access the web-app through my iPad.  The app just gives me an easy way to peruse my movie library (with some details for each, a screenshot, etc) that essentially turns the iPad into an expensive universal remote.  My goal was to have something that works over the wifi in my house rather than dealing with bluetooth remotes and the like.  I could just make an app for it (like mobile mouse or something) but I really wanted to try and see if I could pull this off with a web-app.  I have all that working fine (running the web-app on the iPad accessing the HTPC).

However; I want to make the "Start the Movie" button actually start the movie (on the TV hooked up to the HTPC) by loading VLC (fullscreen) with the selected movie!  I have written a .bat file that, when run from the command prompt, works like a charm!  It loads up VLC in fullscreen mode and starts the movie (at this point the movie file is just hard-coded but eventually I will use cffile to write the .bat file and then call that file to load the selected movie)

When I try to run the .bat file with cfexecute nothing happens.  If I put in a timeout, it just timesout and errors.

This is the bat file I have:


ECHO off

cd\program files (x86)\videolan\vlc

vlc -f "d:\movies\Tron Legacy.mkv"

And here is the code I'm using:

<cfexecute name="C:\WINDOWS\system32\cmd.exe" arguments="/c c:\webserver\websites\test\test.bat" timeout="10">

</cfexecute>

What I've tried:

1) I tried capitalizing c:\ to C:\ in the arguments

2) I tried removing the timeout (doesn't error then, but does nothing at all)

3) I tried increasing the timeout (just takes long to error)

4) I tried naming a variable and dumping the variable (empty string)

5) I tried outputfile (does write the file, but there's nothing in it)

5) I tried just calling the bat file in the name field (as suggested by some) and using 1-5 above all to no avail

I'm tearing my hair out here!  I'm forced to guess this is an issue with some permission somewhere (I was able to find a few pages/posts/threads about cfexecute permissions but none of them were particularly helpful).

Any and all help would be MUCH appreciated!

This topic has been closed for replies.

1 reply

Owainnorth
Inspiring
February 20, 2012

If it's Windows 7, it's almost certainly a permissions thing. Is user account control enabled? Does the user ColdFusion's running as have permissions to execute that file?

JPAGE1976Author
Participant
February 20, 2012

I went into the services and, in the main cf application server, I updated the log on tab to use the same login I use for windows.

Now, it gets even more confusing!!  It will now play the audio of the movie but no video and (this is the weirdest part) absolutely no sign of the VLC player (it's not in the task bar, processes, applications, NOTHING).  It's nowhere to be found and I can't shut it down so I'm stuck with the audio playing (unless I restart or log off/on).  VERY weird!!

If I leave the timeout in the cfexecute tag it still throws the error but plays the sound.  If I take out the timeout it throws no error but the still only plays the audio in the background.

Inspiring
February 21, 2012

This is just running on a personal computer .. right? ;-)

It will now play the audio of the movie but no video and (this is the weirdest part) absolutely no sign of the VLC player

With this specific program, the CF service needs permission to "interact with the desktop". It is disabled by default for security reasons. Enabling it will let you view the VLC window. Disclaimer: I have never used it beyond testing. So I cannot say what security issues that will open up ...