Call msys bash from Windows cmd

I am using GCC on Windows 7 (using the TDM build). I installed MSYS to run Make and compile using make files. However, each time you start the MSYS Bash shell, go to the project directory and run it make.

I want to automate this process. I prefer to have a batch file on Windows or something similar, from which I then invoke the MSYS Bash shell. It should go to the directory where the batch file is located and call make.

Is it possible? Can I send MSYS Bash commands from cmd (e.g. navigation / call make)? Or can I let MSYS Bash run a "Bash script" that sets the execution of commands in the same way as batch scripts?

PS: This is something similar to a stack overflow question Running MSYS from cmd.exe with arguments .

+5
source share
3 answers

Not an MSYS expert, but does something similar for you:

rem Call this something like compile-project.bat
c:
cd \src\project
bash -c "make"
+10
source

bash make MSYS. bin MSYS , Windows. , bash , . , , , - , , .

- Windows Explorer "Bash ", bash . :

[HKEY_CLASSES_ROOT\Directory\shell\mybash]
@="Bash Here"

[HKEY_CLASSES_ROOT\Directory\shell\mybash\command]
@="cmd /c c:\\bash.cmd %1"

bash.cmd c::

@echo off
title bash
cd %1%
bash

, MSYS bin . , , .

+6

MSYS-1.0.11 MSYS bash script (CurrentScript.sh) cmd/bat :

R:\MinGW\MSYS-1.0.11\bin\sh "%cd%\CurrentScript.sh"
0

All Articles