User Tag List

Results 1 to 4 of 4

Thread: Help with executing external program?

  1. #1
    No Products Registered

    Join Date
    Nov 2009
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with executing external program?

    Hey folks,

    My current application relies on a .bat file in order to convert the text files created in my MMF application into the appropriate file format. My .bat file works as intended when executed manually OUTSIDE of the MMF application, however when I launch it using MMF, it does nothing.

    The .bat already contains the relevant command line parameters.

    So, here's an example of my event:

    [color:#33CC00]"Create button is clicked"[/color]
    [color:#FF0000]Execute external program:[/color] [color:#000099]UserDirectory$( "File" )+"\AppData\Roaming\MyApp\Convert.exe"[/color]

    Now, I wasn't sure if perhaps MMF had a problem with .bat files, so I ran the .bat through a converter to make it a .exe, still no result.

    Here's a pic to show the event - as you can see, "Command Line" is empty because the .bat already contains the command line.

    [img:left]http://i47.tinypic.com/2gwrsb6.png[/img]

    All help appreciated

  2. #2
    No Products Registered

    Join Date
    Nov 2009
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help with executing external program?

    Ok quick update, I was able to catch a screenshot of the .bat as it quickly closes when launching via MMF and apparently:

    'convert.exe' is not recognized as an internal or external command, operable program, or batch file. This makes me think there might be a problem with my .bat, but then again - why does it work fine when not launched from MMF?

    The .bat is a simple two line file:

    @echo off
    convert.exe "BASEFILE.DAT"

    Basefile is the file to convert passed as a parameter. Perhaps the .bat needs to be wrriten differently?

  3. #3
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help with executing external program?

    I would guess your bat file relies on the current directory/folder being the one it is in, and when it's launched from MMF the current directory is your program's directory.

    That or your bat file isn't in the appdata folder. I don't see why it would be, anything executable should be in program files with your app.

    Also, if you do need to get at the appdata folder, use "%appdata%" instead of UserDirectory$( "File" )+"\AppData\". %appdata% always works, but on Windows XP (still the most common OS) the folder is called "Application Data" instead of "AppData", so your code wouldn't have worked.

  4. #4
    No Products Registered

    Join Date
    Nov 2009
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help with executing external program?

    Hi Dynasoft, thanks for the quick reply!

    Yep that's right, the bat relies on the file to convert being in the current directory. I've been creating the files in the folder they will ultimately end up in, but perhaps I'll try just creating everything within the MMF application folder then when it's all created, simply move them to the folder they need to be in.

    Thanks a lot for the excellent tip on file locations! I hadn't noticed that documented with the file object, you've saved a lot of potential grief with that tip - cheers!

    I'll go and tweak some things and see what happens

    Happy new year!

Similar Threads

  1. External Program Manipulation
    By McPhisto in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 16th November 2009, 06:18 AM
  2. Execute External Program
    By Eclektik in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 20th May 2009, 10:39 PM
  3. External Program Question...Need Help!
    By MikeB in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 13th December 2008, 05:30 AM
  4. Executing a program BEFORE IC installation?
    By Kevin in forum Install Creator and Patch Maker
    Replies: 2
    Last Post: 25th August 2006, 04:08 PM
  5. External program command line
    By steveb in forum Multimedia Fusion 2 - Technical Support
    Replies: 23
    Last Post: 28th July 2006, 08:54 PM

Posting Permissions

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