A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Open specific file with specific app

  1. #1
    Member
    Join Date
    Sep 2006
    Location
    Montreal
    Posts
    46

    Open specific file with specific app

    Hi I am making a CD project for myself and I've run into a little snag. I am currently using Northcode's "proxy.exe" (thanks btw, that little app has been a life saver) but I have no idea what command to use in the bat file to do this. I've searched google for bat commands, but none seemed to be the one I need.

    Example,

    I have a file "File.zip" and I want it to be opened by a specific app on the CD "App1.exe". We'll say that the app and file are in the same folder called "apps" (/fscommand/apps). How would I do this from the .bat file?

  2. #2
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Normally the command would be something like .\apps\app1.exe file.zip assuming that the BAT files is in the fscommand folder. That might vary depending on how the application expects to see the arguments on the command line (there might be switches, options, etc.)

  3. #3
    Member
    Join Date
    Sep 2006
    Location
    Montreal
    Posts
    46
    Thanks, I'll give it a shot.

  4. #4
    Member
    Join Date
    Sep 2006
    Location
    Montreal
    Posts
    46
    Ok, so it opens the App fine, just not the specific file.

  5. #5
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Make sure the app accepts command line parameters (not all do) and that you're supplying them properly.

  6. #6
    Member
    Join Date
    Sep 2006
    Location
    Montreal
    Posts
    46
    And if it doesn't?

    I tried using the windows "open with" and selected the .exe and it works, don't know if that helps.

  7. #7
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    It depends what application you're talking about and how it opens the target file. Windows apps can use the command line or DDE. If it's DDE only (mostly for older apps) then you're SOL. If it's a command line then all you have to do is look in the registry to find out how Windows opens the file and duplicate that in your BAT file. You can also do this through the Windows Explorer menu if you don't know where to look in the registry.

    1. Open any folder
    2. Select Tools menu at the top of the Window
    3. Select Folder Options from the menu
    4. Select the File Type tab
    5. Find the file type in the list and select it
    6. Click on the Advanced button to bring up the Edit File Type dialog
    7. Select the verb from the list (you want open if it's there)
    8 Press the Edit Button to show the command that will run

    I picked EML (email) files and when I look at the command that's going to run when I click on an EML file to open it, it's this...

    "C:\Program Files\Outlook Express\msimn.exe" /eml:%1

    That's the command line I'd have to run (with %1 replaced by the file I want to open) to get an EML file to open in Outlook Express.

  8. #8
    Member
    Join Date
    Sep 2006
    Location
    Montreal
    Posts
    46
    Got it!

    It ended up being:

    start .\Gen\Fusion.exe ".\Gen\S_D.zip"

    Thanks a lot!

  9. #9
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    You don't need the call to start in there. Normally you would only use start to launch an application if you wanted to specify some additional operating parameters.

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