MathGroup Archive 2005

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

Search the Archive

Re: Calling a MS-DOS command

  • To: mathgroup at smc.vnet.net
  • Subject: [mg56880] Re: [mg56868] Calling a MS-DOS command
  • From: "David Annetts" <davidannetts at aapt.net.au>
  • Date: Mon, 9 May 2005 01:46:01 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Swati, 

> 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.

Really?  

Your vision notwithstanding, on my XP system, Run["ls"] does what is
intended -- open a console (not a DOS command), run the command "ls", then
close the console.  I know that the command was successful since the return
code was 0.  In the unlikely event that you have MKS utilities , Run["dir"]
should do something similar on your system.  

Another command to try would be Run["c:\\Windows\\System32\\cmd.exe"], which
opens a console on XP systems.

Regards,

Dave.


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