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.

How to run a batch file, send commands and collects output on windows

Run["!C:\\runme.bat"]

it outputs 1 and a window appears and then disappears. I also want to send my script file to python shell and collect its output in mathematica. How to do on Windows?

ReadList["!C:\\Python27\\python.exe", "my_script_file.txt"]
share|improve this question
1  
Have a look at 1894 –  b.gatessucks Oct 22 '13 at 7:35
    
It outputs 1 because the batch script outputs 1 as its result. This is a number meant to indicate the success of the script's execution. Run is a very simple command. It runs a string as if you had put it into the command prompt. That's really it. –  Searke Oct 23 '13 at 15:17

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.