MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Run[] and Mathlink

  • To: mathgroup at
  • Subject: [mg43855] Re: Run[] and Mathlink
  • From: "John Jowett" <John.Jowett at>
  • Date: Thu, 9 Oct 2003 01:54:28 -0400 (EDT)
  • References: <bm0j27$po2$>
  • Sender: owner-wri-mathgroup at

Hello James,
        It's not quite impossible.  Instead of something like


you can also try


or even

    Import["!dir","Lines"] .

and you will not get a console window appearing under Windows 2000.   Of
course it is not equivalent to Run[] because Mathematica has to wait for the
"console output"  to appear and the command to terminate.  However that
might be enough, depending on your needs, and it's easier than Mathlink.

[For accelerator people like us:
You may be interested in the runMAD function in my Madtomma`RunningMAD
package which uses this technique to run the MAD program.  It can be
downloaded (with other packages) from

Under Windows 2000 and XP you can set the runMADNThack option to False
(default is still True, maybe I should change that ... ) and the console
windows will not appear.    See also the MADprogram option of runMAD.]

John Jowett

"John Smith" <j.s at> wrote in message news:bm0j27$po2$1 at
> Hi,
> I would like to be able to run operating system commands on win2000
> the dos box popping up all the time. A quick scan through the archives
> shown that this is impossible with the current Mathematica implementation.
> However, the idea of using Mathlink to pass options to CreateProcess() in
> windows as opposed to system() has been suggested as a solution
> Since my knowledge of programming outside mathematica is limited, has a
> member of the group ever programmed this?
> If not, a brief suggestion as to how to at least start programming such a
> function, preferably in C, would be grateful.
> Many thanks,
> James Jones
> ========================================
> Accelerator Physicist
> Accelerator Physics Group
> Daresbury Laboratory
> Warrington,
> Cheshire
> WA4 4AD
> UK
> .

  • Prev by Date: Re: Help with Nonlinear Fitting?
  • Next by Date: RE: Fields or forms on manifolds
  • Previous by thread: Run[] and Mathlink
  • Next by thread: Re: Run[] and Mathlink