How to run .bat file on both windows and mac

0

I am using a .bat file in a Matlab program and was wondering if there was anyway to make this work on both Windows and Mac computers (right now it only works on Windows), so that I can run my Matlab program on both systems. The .bat files are quite short and simple.

Jess

Posted 2014-05-08T15:13:49.863

Reputation: 11

Answers

5

A .Bat file is a Windows Batch file, or a series of Windows commands. Windows commands do not run on Mac.

So in short, no.

What you can do is port the batch file to something that can be run on both Operating Systems. One option for example is to install Python on both machines and write a Python Script to do the same functionality as your current Batch file.

Austin T French

Posted 2014-05-08T15:13:49.863

Reputation: 9 766

1Python should already be installed on the Mac. You'll just have to install Python on the Windows machine. – James Mertz – 2014-05-08T15:23:27.973