Thread Subject: running an external executable

Subject: running an external executable

From: JH

Date: 26 Sep, 2009 02:49:04

Message: 1 of 3

Does anyone know how to get an executable to run by using it's full path? The command in question looks something like this:

--------------------------------------------------------------------------
system('C:\Documents and Settings\Fast\FAST.exe')
--------------------------------------------------------------------------

Apparently, the problem is the spaces in the path and it generates the following error:

--------------------------------------------------------------------------
'C:\Documents' is not recognized as an internal or external command,
operable program or batch file.
--------------------------------------------------------------------------

Is there a way around this problem? Putting everything in a location that has a path with no spaces is not really an option.

Thanks!

Subject: running an external executable

From: Donn Shull

Date: 26 Sep, 2009 03:13:04

Message: 2 of 3

"JH " <jhlaks@colorado.edu> wrote in message <h9jvf0$mt3$1@fred.mathworks.com>...
> Does anyone know how to get an executable to run by using it's full path? The command in question looks something like this:
>
> --------------------------------------------------------------------------
> system('C:\Documents and Settings\Fast\FAST.exe')
> --------------------------------------------------------------------------
>
> Apparently, the problem is the spaces in the path and it generates the following error:
>
> --------------------------------------------------------------------------
> 'C:\Documents' is not recognized as an internal or external command,
> operable program or batch file.
> --------------------------------------------------------------------------
>
> Is there a way around this problem? Putting everything in a location that has a path with no spaces is not really an option.
>
> Thanks!


Try

system('"C:\Documents and Settings\Fast\FAST.exe"')

OK I guess that is hard to see but enclose your string in double quotes then enclose that in single quotes.

Hope This Helps

Donn

Subject: running an external executable

From: JH

Date: 26 Sep, 2009 23:16:02

Message: 3 of 3

"Donn Shull" <donn.shull.no_spam@aetoolbox.com> wrote in message <h9k0s0$m0m$1@fred.mathworks.com>...
> "JH " <jhlaks@colorado.edu> wrote in message <h9jvf0$mt3$1@fred.mathworks.com>...
> > Does anyone know how to get an executable to run by using it's full path? The command in question looks something like this:
> >
> > --------------------------------------------------------------------------
> > system('C:\Documents and Settings\Fast\FAST.exe')
> > --------------------------------------------------------------------------
> >
> > Apparently, the problem is the spaces in the path and it generates the following error:
> >
> > --------------------------------------------------------------------------
> > 'C:\Documents' is not recognized as an internal or external command,
> > operable program or batch file.
> > --------------------------------------------------------------------------
> >
> > Is there a way around this problem? Putting everything in a location that has a path with no spaces is not really an option.
> >
> > Thanks!
>
>
> Try
>
> system('"C:\Documents and Settings\Fast\FAST.exe"')
>
> OK I guess that is hard to see but enclose your string in double quotes then enclose that in single quotes.
>
> Hope This Helps
>
> Donn

Thanks, Donn. That does the trick.

-JH

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
run external exe Sprinceana 26 Sep, 2009 04:54:05
exe Sprinceana 26 Sep, 2009 04:54:05
external exe Sprinceana 26 Sep, 2009 04:54:05
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com