11 Replies - 5187 Views - Last Post: 21 February 2012 - 07:36 PM Rate Topic: -----

#1 DarthMandarb   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 20-February 12

Launch VLC w/ CFEXECUTE

Posted 20 February 2012 - 06:16 PM

I have searched (and searched, and searched) and I cannot figure out what's going on here. I've read 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!

UPDATE:
I have gone into the "services.msc" and under the main Coldfusion Application Server I have updated the log on tab to use the user login that I use for windows. This causes some serious weirdness. Now it behaves the same as above BUT it will play the audio of the movie in the background. There is NO trace of VLC anywhere. No task bar tab, nothing in services, processes (in the task manager), NOTHING!! Just the audio playing in the background and the ONLY way I can stop the audio is to reboot!

Is This A Good Question/Topic? 0
  • +

Replies To: Launch VLC w/ CFEXECUTE

#2 Craig328   User is offline

  • I make this look good
  • member icon

Reputation: 2042
  • View blog
  • Posts: 3,644
  • Joined: 13-January 08

Re: Launch VLC w/ CFEXECUTE

Posted 21 February 2012 - 07:09 AM

Hm. I'll be honest, I've used CFEXECUTE all of once in my career, it was a long time ago and it gave me all kinds of fits back then. Reading your post my initial thought was why not call the .bat file directly rather than go through cmd.exe...but then I saw you already tried that.

The next thought I had was, why not call VLC directly? I did a brief amount of digging and came across this when looking for how to call VLC from the command line. Also, you mentioned that it errors. Can you post the error message? That might provide some clues and if/when you do, mention what version of CF you're using as well.
Was This Post Helpful? 0
  • +
  • -

#3 DarthMandarb   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 20-February 12

Re: Launch VLC w/ CFEXECUTE

Posted 21 February 2012 - 07:31 AM

I'm using Coldfusion 9 Developer (sorry was a little vague in how I mentioned it in the original post!)

It's not throwing an error anymore but the error it was throwing was was:
"Timeout period expired without completion of C:\WINDOWS\system32\cmd.exe"

After much more hair-pulling and blood pressure increasing I've figured out that it IS loading VLC, but it's doing it in the build shell and not displaying it on the desktop. I've tried running the service as "local" with "interact with desktop" checked and it does work... but not visible to the desktop!

I had tried to bypass the cmd.exe and just call the batch file directly. This works as well but produces the same result of playing in the background.

I also tried just calling VLC directly. Same result. Works, but background only.

So I'm slightly encouraged because at least now I know that it DOES work. I just need to figure out how to get it to actually show on the desktop and not stay hidden in the background shell!
Was This Post Helpful? 0
  • +
  • -

#4 Craig328   User is offline

  • I make this look good
  • member icon

Reputation: 2042
  • View blog
  • Posts: 3,644
  • Joined: 13-January 08

Re: Launch VLC w/ CFEXECUTE

Posted 21 February 2012 - 07:38 AM

Hm. That sounds maybe like it's calling the process under the wrong user (maybe using system instead of a logged in user account). That is, it seems that CF is doing what it's supposed to be doing (calling your .bat file) and it's apparent that it's started playing...it just doesn't seem as though VLC is playing under the correct user account perhaps.

When you call it the way you do and it's playing it's showing as LOCAL right? I'd think the solution would be to figure out how to call it to an actual user account (the one that's logged in).
Was This Post Helpful? 0
  • +
  • -

#5 DarthMandarb   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 20-February 12

Re: Launch VLC w/ CFEXECUTE

Posted 21 February 2012 - 07:57 AM

I have tried changing the service's "log on" property to use my windows login information and it works (but still plays it in the background shell). The problem with doing it this way is that now it's playing in the background and I can't get to it anymore so the only way to stop it is to reboot! (in "local w/ interact with desktop" it pops-up a little window telling me there's a message from a program trying to communicate with the desktop and clicking it takes me to the build shell where I could see VLC running).
Was This Post Helpful? 0
  • +
  • -

#6 Craig328   User is offline

  • I make this look good
  • member icon

Reputation: 2042
  • View blog
  • Posts: 3,644
  • Joined: 13-January 08

Re: Launch VLC w/ CFEXECUTE

Posted 21 February 2012 - 08:07 AM

I'm thinking at this point then that the issue isn't so much CF (as the code is executing and calling the VLC app) as it is a Windows accounts/permission problem.

As a test, I'd recommend trying to get some other kind of application to show up to the screen on the server. Something like opening a browser window or displaying an image file. My guess is that you'll run into similar problems. That's actually a good thing though because it allows you to focus your search for a solution on how Windows does its thing.

So yeah, see if this is limited to just VLC or if it affects other kinds of requests similarly. If it's not just VLC but other app's displays then this is a question for the Windows experts.
Was This Post Helpful? 0
  • +
  • -

#7 DarthMandarb   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 20-February 12

Re: Launch VLC w/ CFEXECUTE

Posted 21 February 2012 - 09:38 AM

I was able to launch M$Paint the same way (doesn't show on the desktop) so yeah, I'm thinking now you're assessment is correct and it's not an issue with CF but with Windows.

Thanks for the help!
Was This Post Helpful? 0
  • +
  • -

#8 Craig328   User is offline

  • I make this look good
  • member icon

Reputation: 2042
  • View blog
  • Posts: 3,644
  • Joined: 13-January 08

Re: Launch VLC w/ CFEXECUTE

Posted 21 February 2012 - 09:40 AM

Not a problem. I'm glad to see you're getting it narrowed down. :)

Anyway, let me ask some of the other forum mods for some guidance as to where we might get some help on the Windows thing. Once I hear back from them, I'll post here and let you know.
Was This Post Helpful? 0
  • +
  • -

#9 Curtis Rutland   User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 5106
  • View blog
  • Posts: 9,283
  • Joined: 08-June 10

Re: Launch VLC w/ CFEXECUTE

Posted 21 February 2012 - 12:34 PM

I'm guessing that it's being launched under a different session than the currently logged in user's session. Try this: run the task manager, and make sure you show processes from all users, and display the Session ID for each process.

Posted Image

You should see some of the GUI programs you have in that list, so you'll be able to tell what their session id is.

You should also be able to find VLC's process. See if it's in the same session.

Unfortunately, I don't know how to fix this problem, but it'd be nice to know if that's actually the problem. What I'm guessing is that the web server's service is being started under the default session (0, the one that happens before you even log in), and that's where all subsequent calls are being started as well.
Was This Post Helpful? 0
  • +
  • -

#10 ishkabible   User is offline

  • spelling expret
  • member icon





Reputation: 1747
  • View blog
  • Posts: 5,898
  • Joined: 03-August 09

Re: Launch VLC w/ CFEXECUTE

Posted 21 February 2012 - 02:16 PM

cd\program files (x86)\videolan\vlc
are you sure that works? maybe you meant cd "C:\program files (x86)\videolan\vlc" instead?

I think I would just call VLC directly too; that way you can avoid an extra shell(depending on how that tag works it might avoid a shell all together)

This post has been edited by ishkabible: 21 February 2012 - 02:22 PM

Was This Post Helpful? 0
  • +
  • -

#11 GunnerInc   User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 918
  • View blog
  • Posts: 2,358
  • Joined: 28-March 11

Re: Launch VLC w/ CFEXECUTE

Posted 21 February 2012 - 04:25 PM

Once you change to the vlc directory with CD in the batch file, instead of doing:
vlc -f "d:\movies\Tron Legacy.mkv"


would this work:
start /max vlc -f "d:\movies\Tron Legacy.mkv"


http://www.computerh...om/starthlp.htm
Was This Post Helpful? 0
  • +
  • -

#12 Curtis Rutland   User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 5106
  • View blog
  • Posts: 9,283
  • Joined: 08-June 10

Re: Launch VLC w/ CFEXECUTE

Posted 21 February 2012 - 07:36 PM

Unfortunately, I think that approach will suffer from the same issue. It'll be started on the Windows Session that the web server is running under, which is likely the default session, not the user's current session (which makes sense, you want the web server running even if you're not logged in, and if there are more than one logged in users, how would it know which session to start the program on?).
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1