1

I have a batch script(master.bat) which calls a host of batch scripts. Master.bat:

call a.bat
call b.bat
call c.bat

The shell script(call_master.sh) that calls this batch script is:

echo $PATH
cmd /c master.bat

I am invoking this shell script on Windows-7 using Git Bash. When i run the shell script I don't get any errors but None of the scripts is getting invoked by master.bat. What should be done to to do this correctly

1 Answer 1

5

It might help to double the slash in the /c switch so it is not interpreted as the C: drive by the shell.

I made a little test, and this was the command and output:

$ cmd //c master.bat

> call a.bat

> echo hello from a
hello from a

> call b.bat

> echo hello from b
hello from b

> call c.bat

> echo hello from c
hello from c

Here's another reference from the Mingw wiki about path conversion.

Sign up to request clarification or add additional context in comments.

2 Comments

Is there a way to run this batch in a new window? I mean, somehow, let it detached from the Git Bash shell flow to evaluate independently.
Found the answer, it's simply: start file.bat

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.