Re: Calling .exe with Run
- To: mathgroup at smc.vnet.net
- Subject: [mg66118] Re: [mg66102] Calling .exe with Run
- From: Shyam Guthikonda <shyamguth at gmail.com>
- Date: Sun, 30 Apr 2006 04:21:10 -0400 (EDT)
- References: <200604290741.DAA23498@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
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] SetDirectory[ToString[thisdir]] executable = "finalProject.exe" param1 = ToString["\"" <> thisdir] Run[executable, param1] _Shyam 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 > > > >
- References:
- Calling .exe with Run
- From: Marco Gabiccini <m.gabiccini@ing.unipi.it>
- Calling .exe with Run