8 Replies Latest reply on Feb 21, 2012 5:57 AM by -==cfSearching==-

    CFEXECUTE / vlc

    JPAGE1976

      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!

        • 1. Re: CFEXECUTE / vlc
          Owain North Level 4

          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?

          • 2. Re: CFEXECUTE / vlc
            JPAGE1976 Level 1

            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.

            • 3. Re: CFEXECUTE / vlc
              -==cfSearching==- Level 4

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

              • 4. Re: CFEXECUTE / vlc
                JPAGE1976 Level 1

                Yes this is only for my home network.  The HTPC is connected to my big TV and runs the coldfusion server and I access it (through a safari web-app on my iPad) so the UI isn't on the big TV at all, just my ipad screen.  This part works perfectly with no issues and is quite slick.  It is, however, useless 'cause it can't actually play the movies (yet)

                 

                Okay... I opened up services.msc and went back to "Local System Account" and checked the "interact with desktop" box.  Now I'm getting a little popup from "Interactive Services Detection" telling me that there's a program that's trying to display a message.  If I click it, it takes me into a new screen (almost like a remote desktop - I can't see the desktop in it) where I can see the jrun.exe command prompt (but it's doing nothing).  If I return to windows and run my file (which cfexecutes the batch file) and then go back to that other screen it IS loading vlc in that window but it's not visible on my desktop!

                 

                I'm obviously missing something but I'm buggered if I can figure out what it is!

                • 5. Re: CFEXECUTE / vlc
                  Dave Watts Adobe Community Professional

                  Instead of running CF as a service, you might instead run it as an application started from within your login session. This would avoid the "interact with desktop" issue, which doesn't work the same way it used to, by default.

                   

                  If you're running CF as a standalone server, look for cfstart.bat somewhere within the CF install directory, probably in the bin subdirectory.

                   

                  Dave Watts, CTO, Fig Leaf Software

                  • 6. Re: CFEXECUTE / vlc
                    -==cfSearching==- Level 4

                    This would avoid the "interact with desktop" issue, which doesn't work the same way it used to, by default.

                     

                    Just curious, how has it changed? (I think the last time I used it was on the ancient xp)

                    • 7. Re: CFEXECUTE / vlc
                      Dave Watts Adobe Community Professional

                      Just curious, how has it changed? (I think the last time I used it was on the ancient xp)

                       

                      By default, it doesn't just launch applications within the current shell's environment, as it used to - I, like you, used it on XP and 2000 (and probably 2003) to do things like open apps I didn't have permission to run myself on the desktop. Now, there's some sort of segregation where the user has to allow addiitional interaction when it happens. You might be able to override this segregation, as described here, but I haven't tested it:

                       

                      http://lostechies.com/keithdahlby/2011/08/13/allowing-a-windows-service-to-interact-with-d esktop-without-localsystem/

                       

                      Dave Watts, CTO, Fig Leaf Software

                      • 8. Re: CFEXECUTE / vlc
                        -==cfSearching==- Level 4

                        Cool, thanks. I will have to give that a try later. See if it works.

                         

                         

                        -Leigh