5 Replies Latest reply on Oct 4, 2007 2:52 PM by SymTsb

    Flash CS3 FSCommand w/Arguments Sollution Found

    DinoRoger Level 1
      Setup:
      - Adobe Flash CS3
      - Local published exe file only

      I was writing a application in flash that will call DVD playback software with command line arguments to launch a specified movie path on the hard drive. The problem I ran into was ActionScript 3.0 FSCOMMAND prevented all command line arguments. In addition to the argument problem it would only allow EXE's to be launched from a sub folder titled 'FSCOMMAND'. After searching hours for a solution or different method I was just about to give up. That is when it came to me. I could pass infomration though the clipboard to talk to another exe. This other exe could then launch any exe from any location and include command line arguments.

      I created my custom exe called FSCFixed.exe. Usage below:

      The below are the only two lines of AS code needed to launch a file:
      System.setClipboard("FSCOMMAND C:\\WINNT\\Notepad.exe C:\\MyTextFile.txt");
      fscommand("exec","FSCFixed.exe");

      So in the same path as your flash exe you would create a new folder called FSCOMMAND and place the FSCFixed.exe into that folder. Then you can change the clipboard data to any exe path w/argumants that you wish.

      You can also add one of the following switches in the command line to do the following:
      $MIN = Launches your application minimized without focus
      $MAX = Launches your application maximized with focus
      $HIDE = Launches your application hidden (can only be seen in task amanger)

      If you do not specify a switch it will be ran in normal window mode with focus.

      I am not sure if this feature is needed by the community as much as I needed it, but I wanted to share just in case. I know I spent a long time trying to find a solution without any progress from the WWW. If you are interested in testing this e-mail dinoroger@flicksilver.com and I will send you a link to the exe file and instructions. If you like it and does what you need it to do write back to this post to let others know.
        • 1. Re: Flash CS3 FSCommand w/Arguments Sollution Found
          kglad Adobe Community Professional & MVP
          i just wanted to make a comment on this thread to move this post back to the top. it's a significant contribution. (it may also give adobe some pause because of security concerns, but that's another matter.)
          • 2. Re: Flash CS3 FSCommand w/Arguments Sollution Found
            DinoRoger Level 1
            quote:

            Originally posted by: kglad
            i just wanted to make a comment on this thread to move this post back to the top. it's a significant contribution. (it may also give adobe some pause because of security concerns, but that's another matter.)


            I defiently agree about the security concern, but also feel if someone wanted to abuse flash to bypass security they would just code using an older version of flash that allowed FSCOMMAND to function with arguments. Taking a feature that already existed in previous versions does not remove the security risk. Also it feels that the power of flash without this feature seriously crippled the applications that could be written with flash. I understand Adobe wants to prevent a headline of "Flash movies infects millions of user's computers', but by crippiling a feature it is punishing millions of users because of a few. Also command line arguments would not stop a virus anyway. A user could easily just code a exe that called another exe without arguments to perform any function they wanted on the user's system. Since when does a virus install require command line arguments to cause problems. Sorry for the soap box stance, but this crippled features really pissed me off. :)
            • 3. Re: Flash CS3 FSCommand w/Arguments Sollution Found
              kglad Adobe Community Professional & MVP
              i don't understand the security issues, myself but i think that was the reason for the restriction requiring exe files to be in an fscommand directory.

              i don't think coding for an older flash player version would work (unless a user had an older flash version). i think the security check is built into the flash player and it's the player that requires the exe to be in an fscommand directory.
              • 4. Flash CS3 FSCommand w/Arguments Sollution Found
                DinoRoger Level 1
                quote:

                Originally posted by: kglad
                i don't think coding for an older flash player version would work (unless a user had an older flash version). i think the security check is built into the flash player and it's the player that requires the exe to be in an fscommand directory.


                It would work since the older flash player is built into the flash exe you compile (projector). Meaning the flash app must be an older version not just compile using an old player export.
                • 5. Re: Flash CS3 FSCommand w/Arguments Sollution Found
                  SymTsb Level 2
                  Wonderful contribution Dino!!!

                  As far as the security issues of the player are concerned, I think AIR is going to eliminate the need to address this any longer within the Flash Player API. As more and more AIR applications are built and the APIs become more and more readily used, I have a feeling that FSCommand will be a complete thing of the past. The applications that are using it now, will probably move over to AIR's feature set because it will allow them greater application style control. It's ability to handle the local file system etc. could eliminate most of the security risks incurred by the Flash player and the use of FSCommand.