Results 1 to 6 of 6
  1. #1


    Member Since
    Aug 13, 2013
    Posts
    2
    Lightbulb How to execute *.bat file in Mac
    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

  2. #2

    TattooedMac's Avatar
    Member Since
    May 19, 2009
    Location
    Waiting for a mate . . .
    Posts
    8,441
    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.
    Dont forget to use the Reputation System if someone has helped you out !!!
    Arguing with a zealot is only slightly easier than tunneling through a mountain with your forehead!!!!!
    MoTM ☆☆☆

  3. #3


    Member Since
    Aug 13, 2013
    Posts
    2
    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?

  4. #4

    TattooedMac's Avatar
    Member Since
    May 19, 2009
    Location
    Waiting for a mate . . .
    Posts
    8,441
    Specs:
    21" iMac 2.9Ghz 16GB RAM - 10.11.3, iPhone6s & iPad Air 2 - iOS 9.2.1, ATV 4Th Gen tvOS, ATV3
    Not sure it can be done as its a Windows executable file but have a look at this . . . . Is there a way to run a .bat file on a mac? - Yahoo! Answers

    PS What Program as there might be a Mac equivalent ??
    Dont forget to use the Reputation System if someone has helped you out !!!
    Arguing with a zealot is only slightly easier than tunneling through a mountain with your forehead!!!!!
    MoTM ☆☆☆

  5. #5

    cwa107's Avatar
    Member Since
    Dec 20, 2006
    Location
    Lake Mary, Florida
    Posts
    26,954
    Specs:
    15" MBP, Core i7/2GHz, 8GB RAM, 480GB Crucial M500 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.
    Liquid and computers don't mix. It might seem simple, but we see an incredible amount of people post here about spills. Keep drinks and other liquids away from your expensive electronics!

    https://youtu.be/KHZ8ek-6ccc

  6. #6

    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    8,817
    Specs:
    27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 6S, iPod Nano 7th GeniPad 3
    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..
    --
    Regards
    ...Ashwin



    Be sure to read the Community Guidelines | The more information you provide, the better answers you get, remember GIGO.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. cant execute compiled file with g++
    By loux in forum Running Windows (or anything else) on your Mac
    Replies: 9
    Last Post: 02-03-2012, 02:52 PM
  2. file .bat for mac
    By sav2 in forum OS X - Development and Darwin
    Replies: 4
    Last Post: 10-10-2011, 03:33 PM
  3. Cannot execute binary file?
    By Larkin in forum OS X - Development and Darwin
    Replies: 4
    Last Post: 02-16-2011, 12:09 PM
  4. how to execute a .exe file
    By andrewbali in forum Switcher Hangout
    Replies: 12
    Last Post: 04-28-2008, 05:28 AM
  5. Is .app the binary execute file?
    By AlexN in forum Switcher Hangout
    Replies: 3
    Last Post: 09-23-2005, 12:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •