How to execute *.bat file in Mac

Joined
Aug 13, 2013
Messages
2
Reaction score
0
Points
1
Hi,

How will I run a *.bat files in Mac?
I am not at all a Mac Savvy, Would highly appreciate, If any one can provide me with the step by step instruction to execute bat files in Mac.PFB the contents of my bat files

Code:
echo
Running ConfigureTests.py  to get the selections regarding the test cases to be executed

ConfigureTests.py

echo Now, the configurations are saved to TestConfig.txt file.

echo Please ensure that squishserver  is running before starting the automated testing

echo To start squishserver cd to the squish bin folder in a separate command prompt window and then type squishserver 
Example:  "cd I:\squish-4.0.2-qt47x-win32-msvc8\bin\    and then squishserver"

runTests.py

echo Please check I:\Test Results\index.html to examine the Test Execution Report

Thanks in advance,
Camy
 
Last edited by a moderator:
Joined
May 19, 2009
Messages
8,428
Reaction score
295
Points
83
Location
Waiting for a mate . . .
Your Mac's Specs
21" iMac 2.9Ghz 16GB RAM - 10.11.3, iPhone6s & iPad Air 2 - iOS 9.2.1, ATV 4Th Gen tvOS, ATV3
From what i know a .bat file is only a windows batch file script. A .bat file should not be able to run on a Mac at all. They are specific windows commands that make them.

So your options are to run Windows in a VM or via Bootcamp.

Why is it that you need to run a .bat file on your Mac ?

Or you can buy CrossOver for Mac, and try this

Start CrossOver, if it's not already running
Menu Bar -> Programs -> Run Command...
Select the bottle to use - for you this would be the bottle you're installing the game in
Click Browse and find your BAT file
Click Run

I cant guarantee anything that it will work, but from what i have read, the best and easiest way is to run a VM or Bootcamp for Windows and executing a .bat file, especially if your trying to get it into a game.
 
OP
C
Joined
Aug 13, 2013
Messages
2
Reaction score
0
Points
1
coz I need to run an application in mac,I used to call that application by running a particular bat file from command mode in windows.Is there a way to change *.bat file to *.bash file?
 

cwa107


Retired Staff
Joined
Dec 20, 2006
Messages
27,042
Reaction score
812
Points
113
Location
Lake Mary, Florida
Your Mac's Specs
14" MacBook Pro M1 Pro, 16GB RAM, 1TB SSD
Let's assume you're Chinese and don't speak a lick of English.

Let's further assume that you need to do a task that consists of several steps, each with very specific instructions.

Now, someone hands you directions for that task and they are written in.... you guessed it... English. That's not going to work, will it?

That's what you're looking at here. .bat files are MS-DOS batch files. OS X, being based on UNIX, has no idea what to do with a .bat file. And just as you can't change the name of the English instructions mentioned above and have it understandable in Chinese, you can't simply change the extension on the .bat file and have it recognized by OS X.

That said, there are many different ways to script automated solutions with OS X. The easiest of which is Automator, which is built right into OS X (look in your Applications folder). There is also AppleScript. And if for whatever reason, you want to delve even deeper into scripting, there you can do shell scripting. An excellent guide is available here.

What you need to do next is to decipher that .bat file and find out what it actually does. Break it out into vey basic steps. Then, translate those actions into your scripting solution of choice, depending on which is most appropriate.

Hope that makes sense.
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,762
Reaction score
2,100
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
The BATch file is very trivial in what it does, converting it to a BASH script is as simple as

Code:
#!/bin/bash

echo  "Running ConfigureTests.py  to get the selections regarding the test cases to be executed"

./ConfigureTests.py

echo "Now, the configurations are saved to TestConfig.txt file."
echo "Please ensure that squishserver  is running before starting the automated testing"
echo "To start squishserver cd to the squish bin folder in a separate command prompt window"
echo "and then type squishserver:"
echo "Example:  cd I:\squish-4.0.2-qt47x-win32-msvc8\bin\    and then squishserver"

./runTests.py

echo "Please check I:\Test Results\index.html to examine the Test Execution Report"

However, this will do nothing for you for a couple of reasons. You need this Squishserver to be available on OS X. If you don't have that, you cannot proceed. You might have to modify the two python scripts minimally to set the correct path to the Python interpreter..

Open up the Terminal (Applications->Utilities->Terminal) and type
Code:
which python

This should return a valid path name as opposed to just returning with no output. If you get a valid path, then that's the path you want to use in your python scripts..
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top