Sign in to follow this  
Followers 0
Radsam

Run a non .exe file

7 posts in this topic

I need to run an associated file.

For example,

Run("C:\somefile.mex")

How can I do this?

Share this post


Link to post
Share on other sites



Can you please use the search function first?

Thank you.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I need to run an associated file.

For example,

Run("C:\somefile.mex")

How can I do this?

The "Run" function supports only stand-alone executables (EXE, BAT, COM, PIF) - check the helpfile for more on this.

If you want to execute an assosiated file, you must also call its program in the same line. I.e.:

Run("notepad.exe myfile.txt")

Check the helpfile and you 'll understand..

Edited by erebus

Share this post


Link to post
Share on other sites

1. This question has been asked 20 times before.

2. It's in the FAQ since forever

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Just an addition, it very IS possible to run a none-executable.

The catch is that you need the program _that it opens with_. In this style:

Run('"$programtopenwith" "$fullpathoffile"')

and example of this is for an .html file you need

Run('"iexplorer" "file.html"')

SOME PROGRAMS NEED ADDITIONAL PARAMETERS->check the registery for specifics on none-windows programs.

Edited by Wolvereness

Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]

Share this post


Link to post
Share on other sites

I need to run an associated file.

For example,

Run("C:\somefile.mex")

How can I do this?

<{POST_SNAPBACK}>

Let Windows decide which .exe to run by using the Windows START command...

Run(@COMSPEC & " /C START C:\somefile.mex")

:idiot:

Share this post


Link to post
Share on other sites

Also, try searching the forums for ShellExecute, someone has found a way to do this using DLLCall.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0