execute external program

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
pucker22
Posts: 2
Joined: Sat Jun 28, 2008 1:55 am

execute external program

Post by pucker22 »

Is runrev capable of executing a .exe file?

For example, when the user clicks the button the file c:/windows/notepad.exe is opened?


If so, can someone give me a example code?

Thank you!
Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark »

Pucker:

put "start '' 'c:/windows/notepad.exe'" into myShell
replace "'" with quote in myShell
get shell(myShell)

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus »

Hi pucker22,

or a bit shorter :-)

Code: Select all

...
launch "c:/windows/notepad.exe"
...
Check the docs for more info about "launch".


Best

Klaus
Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark »

Hi Klaus,

I always use the shell function, because the launch command is subject to change and doesn't work correctly in quite a few releases.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus »

Dag Mark,

AHA! Good to know!
Thanks for the hint, will also switch to "shell" :-)


Best

Klaus
paul_gr
Posts: 319
Joined: Fri Dec 08, 2006 7:38 pm

Post by paul_gr »

If using the shell function you will probably want to use
set the hideConsoleWindows to true
to stop the console window flashing on and off before the exe is called.

Paul
Post Reply