MathGroup Archive 2006

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

Search the Archive

Re: Calling .exe with Run

Thanks for that example. It gave me the idea to use SetDirectory (along 
with some of Chris' code) to get around the problems. Here is my final 
code that works for directories and 1 parameter with spaces (it so 
happens that my parameter is the same as directory):

nbfile = ToFileName["FileName" /. NotebookInformation[EvaluationNotebook[]]]
thisdir = DirectoryName[nbfile]
executable = "finalProject.exe"
param1 = ToString["\"" <> thisdir]
Run[executable, param1]


Marco Gabiccini wrote:
> Maybe this is not exactly what you meant to do but here is my example for you.
> This is just a call to cmd.exe to see, in the DOS window, the files in the 
> directory C:\Marco.
> SetDirectory["C:\Marco"]
> batfilecontent = ToString[ColumnForm[
> {"cd\\","dir/p"}, Left]
> ];
> Export["call.bat", batfilecontent, "Table"]
> Run["call.bat"]
> I hope this helps.
> Marco Gabiccini

  • Prev by Date: Difference between the following integrals....
  • Next by Date: Re: your mail
  • Previous by thread: Calling .exe with Run
  • Next by thread: Why D[x', x] isn't 0 ?