5
$\begingroup$

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.

$\endgroup$
7
  • 3
    $\begingroup$ The tutorial on running external programs would be a good place to start $\endgroup$ Commented Jul 22, 2013 at 10:33
  • $\begingroup$ @SimonWoods I tried with Run and Runthrough in the following way. but not working Run[.exe FilePath] $\endgroup$
    – subbu
    Commented Jul 22, 2013 at 11:19
  • $\begingroup$ @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. $\endgroup$
    – subbu
    Commented Jul 22, 2013 at 12:21
  • $\begingroup$ 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. $\endgroup$
    – Mr.Wizard
    Commented Jul 22, 2013 at 14:03
  • 1
    $\begingroup$ Have you tried unchecking the "Always ask before opening" checkbox in that dialog that came up? $\endgroup$
    – Szabolcs
    Commented Sep 21, 2013 at 16:43

1 Answer 1

2
$\begingroup$

I would do the following.

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

And then use SystemOpen to call the file.

$\endgroup$
2
  • 1
    $\begingroup$ 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. $\endgroup$
    – subbu
    Commented Jul 22, 2013 at 16:53
  • 1
    $\begingroup$ @subbu I dont know much about the internals, I was just trying to get it to work. $\endgroup$
    – William
    Commented Jul 22, 2013 at 16:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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