Execute a program from Rev.

Ken Ray kray at sonsothunder.com
Sat Jan 15 18:31:29 EST 2005

On 1/15/05 5:18 PM, "Paul Salyers" <ps1 at softseven.org> wrote:

> on mouseUp
>    shell("Program.exe")
> end mouseUp
> I have a pics of our Program.exe program & I want to execute it when I
> click the image. This shell programs and programs to be run will be in the
> same folder. I prefer not to have to use the full path, as some people
> might want to move to a different folder. This version will be for Windows.

Well, when ever you use a partial path, it assumes that it is relative to
the defaultFolder, which when your main program starts is located at the
folder that contains the standalone. So if you had an application called
"MyProgram.exe" in the same folder as your standalone you could do any of
the following (different methods of launching an app:

  launch "MyProgram.exe"
  open process "MyProgram.exe" for neither

You could also use shell(), but that uses effectively the DOS console and
that has a different default directory that you'd have to 'cd' to before you
launched your app using a relative path, or you'd have to provide the full
path, as in:

  get shell("start C:\MyFolder\MyProgram.exe")

I'd recommend using either "launch" or "open process".


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com

More information about the Use-livecode mailing list