A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Command Line Arguments

  1. #1
    Senior Member
    Join Date
    Nov 2000
    Posts
    302
    I need to pass some arguments from the command line in dos to a .exe and was wondering how to do it.
    I thought of another way around the problem (.bat file that changes the value of an .ini file) but I just wanna know if you can do it the other way.
    cheers guys
    aLaN


  2. #2
    Senior Member
    Join Date
    Jun 2000
    Posts
    666
    All statements must be expressions..

    In Flash 4 or earlier it's
    "some.exe" & Chr(9) & "/argument1" & Chr(9) & "/ect"

    In Flash 5 it's
    "some.exe" add Chr(9) add "/argument1" add Chr(9) add "/ect"

    Keep in mind that slashes are different in Flash 5

  3. #3
    Senior Member
    Join Date
    Nov 2000
    Posts
    302

    I don't understand...

    is this the DOS line command?


  4. #4
    Senior Member
    Join Date
    Jun 2000
    Posts
    666
    No it's the syntax for flash to be able to pass command line arguments the & Chr(9) & allow's a space to be processed on the commmand line

    Using a expression and & Chr(9) & will allow spaces in Flash

  5. #5
    Senior Member
    Join Date
    Nov 2000
    Posts
    302

    Ok that's great but...

    I want to be able to use the command line in dos to pass some parameters to a projector .exe file. that's what i am asking if it's possible...


  6. #6
    Senior Member
    Join Date
    Jun 2000
    Posts
    666
    And that's what I'm showing the example code in my first post does just that..

    Replace the name some.exe with your executable names and replace the arguments with your executables arguments if you need further help with this subject I suggest you see my program (which uses command line parameters in Flash) and or search this board...

  7. #7

    resolved

    Lol.. Pure_Morning.. YES that is the DOS Prompt. I don't understand why he said no, but it is. You want to replace "some.exe" with the path to "command.com" and then add your command line switches, seperated by chr(9). Chr(9) is actually a TAB, but it acts as a space when processed. I suggest you add the command line switch "/c" before all other switches. That will close the DOS prompt box that pops up after it runs the commands you tell it. Much better than having the user do it him/herself. Oh and one more thing - download this example of a Windows "Run" box I made.. which uses the DOS Command Line to open any file that has a program associated with it on the user's computer (and is automatically opened by the program it is associated with). Let me know if you have any problems

  8. #8
    The Supreme Shaman and Keeper of Polar Lights
    Join Date
    Apr 2000
    Posts
    1,175
    Hi !

    In Flash 5 we can also replace spaces with tabs in expert mode or just write
    \t
    instead of all spaces

    And about calling native applications
    It is always possible to say just
    FS Command ("exec", "start\tC:\\somefolder\\name.mp3")
    for 95-98
    FS Command ("exec", "cmd\t/c\tC:\\somefolder\\name.mp3")
    for NT-2000

    [Edited by Ilya on 01-20-2001 at 09:37 PM]

  9. #9

    resolved

    Ilya..
    That's the exact method I used in the Standalone on the link above. I used chr(9) though, because I wasn't aware of the \t switch. I'll use that Hey Ilya.. since you seem to be pretty good with Command Line Arguments, do you know of a way to paste Variables from Flash directly to another application window? Click here to see my FlashKit post asking for help and a picture of the program I want to use this with. If you could help it'd be great

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center