Can you run .bat files on a mac?

Joined
Jul 20, 2011
Messages
42
Reaction score
0
Points
6
I have batch file i need to run in terminal. I have tried running it in terminal but it didn't work. Is there anyway of doing running this? Or is it a windows only file?
 
Joined
Oct 22, 2007
Messages
8,967
Reaction score
287
Points
83
Location
London
Your Mac's Specs
Mac Mini Core i7 2012 | White 2009 MacBook 2 Ghz | 733 Mhz G4 Quicksilver
Windows only (well, more accurately a DOS file)

But what is the BAT file designed to do, its function could probably be replicated on the mac
 
OP
T
Joined
Jul 20, 2011
Messages
42
Reaction score
0
Points
6
Ok thanks, It is used as a emulator for Linux for a University project I am doing so will have to use windows for it!
 
Joined
Oct 22, 2007
Messages
8,967
Reaction score
287
Points
83
Location
London
Your Mac's Specs
Mac Mini Core i7 2012 | White 2009 MacBook 2 Ghz | 733 Mhz G4 Quicksilver
You want to run linux on a mac then?
 
OP
T
Joined
Jul 20, 2011
Messages
42
Reaction score
0
Points
6
It is a project which is supposed to get us used to linux commands. Their is no GUI and just using commands to see what the outcomes are.
 
Joined
Oct 22, 2007
Messages
8,967
Reaction score
287
Points
83
Location
London
Your Mac's Specs
Mac Mini Core i7 2012 | White 2009 MacBook 2 Ghz | 733 Mhz G4 Quicksilver
You could us terminal which is just UNIx or install ubuntu in a VirtualBox virtual machine to use linux
 

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
It is a project which is supposed to get us used to linux commands. Their is no GUI and just using commands to see what the outcomes are.

That's pretty funny.

So, a batch file is just a series of DOS commands structured in such a way as to perform a series of actions. My guess is your .bat file probably has a series of prompts and responses that make the Windows Command Prompt look like Linux.

What is really interesting about this is that your Mac essentially uses the same shell as many Linux distributions (bash). So, you can use the commands for real right on your Mac without having to run any sort of "emulator".

I would also recommend to the educator that he or she simply burn the class some Linux "live" CDs to practice with.
 
Joined
Sep 22, 2010
Messages
197
Reaction score
1
Points
18
Location
London
Your Mac's Specs
Imac 21.5 Inch 3.06 GHZ 4GB Ram 500 Gig HD, Ipad 32 GB, Iphone 4S 16 GB.
That's pretty funny.

So, a batch file is just a series of DOS commands structured in such a way as to perform a series of actions.

Correct.

A Bat file may be used by an IT department to connect to a series of drives for users on the network.

Granted the users could do this themselves but the bat file automates it and is pushed out to all users on the network.

This may be done to ensure the correct drives are loaded and to compensate for users who may be unaware of how to do this.
 

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

A Bat file may be used by an IT department to connect to a series of drives for users on the network.

Granted the users could do this themselves but the bat file automates it and is pushed out to all users on the network.

This may be done to ensure the correct drives are loaded and to compensate for users who may be unaware of how to do this.

There's lots of uses for a batch file, mapping drives being one of them. I wasn't really asking a question here, more like explaining what a .bat file does and why it's sort of silly that one would be used for the purposes of emulating Linux.
 
Joined
Sep 22, 2010
Messages
197
Reaction score
1
Points
18
Location
London
Your Mac's Specs
Imac 21.5 Inch 3.06 GHZ 4GB Ram 500 Gig HD, Ipad 32 GB, Iphone 4S 16 GB.
There's lots of uses for a batch file, mapping drives being one of them. I wasn't really asking a question here, more like explaining what a .bat file does and why it's sort of silly that one would be used for the purposes of emulating Linux.

Sorry my mistake.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Depending on the requirements, you would probably be better off using a Linux VM to do this. The set of available commands in OS X and more importantly, the filesystem layout, are different enough such that you may notice inconsistencies. While 90% of what you do will be the same across platforms, you're probably better off taking the time to create a Linux VM and use that.
 

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