# How can I run .exe file in Mathematica

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

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.

-
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
Have you tried unchecking the "Always ask before opening" checkbox in that dialog that came up? – Szabolcs Sep 21 '13 at 16:43

file = OpenWrite[FileNameJoin[{\$TemporaryDirectory, "testfile.bat"}]]

And then use SystemOpen to call the file.
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