Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

we have a .exe file. It takes input as .txt file and gives output as another .txt file.

Now, I want to run that .exe file from MM.

I tried in 2 way,

Case 1 :

using SystemOpen[].

It showing the following Window, Once I run the SystemOpen[path].

enter image description here

I click on Run button.after it's not showing anything.

for my conformation, Manually I double click on .exe file. it's working fine. but SystemOpen[] was not working.

case 2:

I created .bat file with the following code

   cd C:\Users\Infratab Bangalore\Desktop\Rod's
   Infratab1-2.exe

Now I open .bat file using same function SystemOpen[]. here it's working great.

How can I fix case 1 problem. If anybody knows suggest me.

Thanks.

share|improve this question
3  
The tutorial on running external programs would be a good place to start –  Simon Woods Jul 22 '13 at 10:33
    
@SimonWoods I tried with Run and Runthrough in the following way. but not working Run[.exe FilePath] –  subbu Jul 22 '13 at 11:19
    
@SimonWoods If I use any functions like, CompilationTarget.it showing A C compiler cannot be found on your system. Please consult the \ documentation to learn how to set up suitable compilers. so Am I need to install C in my system. –  subbu Jul 22 '13 at 12:21
    
Thanks for adding some relevant information. That at least looks like a question that one can attempt to answer now, so I have reopened this. –  Mr.Wizard Jul 22 '13 at 14:03
1  
Have you tried unchecking the "Always ask before opening" checkbox in that dialog that came up? –  Szabolcs Sep 21 '13 at 16:43
show 2 more comments

1 Answer

I would do the following.

file = OpenWrite[FileNameJoin[{$TemporaryDirectory, "testfile.bat"}]]
WriteString[file, "call path"]

And then use SystemOpen to call the file.

share|improve this answer
    
Why do I need to create another files. Already I have Input files,just I need to execute .exe file.Automatically it will take every thing. –  subbu Jul 22 '13 at 16:53
    
@subbu I dont know much about the internals, I was just trying to get it to work. –  Liam William Jul 22 '13 at 16:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.