MathGroup Archive 2005

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

Search the Archive

Re: Calling a MS-DOS command

  • To: mathgroup at
  • Subject: [mg56896] Re: Calling a MS-DOS command
  • From: OT <montoz at>
  • Date: Mon, 9 May 2005 01:46:34 -0400 (EDT)
  • Organization: C.U. Srl Usenet Server
  • References: <d5kasq$29r$>
  • Sender: owner-wri-mathgroup at

Swati Shah ha scritto:
> Hi everyone,
> I would like to call some DOS commands from Mathematica like 
> delete ("tmp.txt")
> copy filea to fileb
> Is this possible in Mathematica? I have been looking at the
> documentation but am not having a lot of luck.
> Thanks in advance

You can use the Run[] command:
Run[expr_1,expr_2,... ] generates the printed form of the expressions 
expr_i, separated by spaces, and runs it as an external, operating 
system, command.

Note that
!"command" is the same of

As an example, under windows the input
starts the MS-DOS console. In this case after the ms-dos console is 
started the front end still looks like evaluating, because it's waiting 
for the end of the external command. When you close the ms-dos console, 
mathematica will know that the execution of the external, system code is 
ended and you'll be able to do new computation in the front end.

If you evaluate

you'll see..



  • Prev by Date: Re: How to quickly find number of non-zero elements in sparse matrix rows?
  • Next by Date: Re: Calling a MS-DOS command
  • Previous by thread: Re: Calling a MS-DOS command
  • Next by thread: Re: Calling a MS-DOS command