I have a small script utility called clear.bat that does some homework in my sources.
This is a .bat file so that I can easily double-click it in Windows Explorer.
Sometimes itβs more convenient for me to execute it from my Git bash (msysgit, if that matters).
To do this, enter
cmd clear.bat exit
cmd turns my git bash into a normal cmd window where I can easily execute my batch. When I type exit , the cmd environment exits and I return to my Git bash.
Could this be achieved in a simpler way?
I tried cmd /C clean.bat as docs said
Syntax CMD [charset] [options] CMD [charset] [options] [/c Command] CMD [charset] [options] [/k Command] Options /C Run Command and then terminate /K Run Command and then return to the CMD prompt. This is useful for testing, to examine variables
Edit:
Just noticed that the message is broken.
I want to execute clean.bat from Git bash without having to enter the three commands above ( cmd , clear.bat , exit ). I just want to execute the .bat file from my git bash. The obvious way would be to create a separate .sh file that does the same job, but this will lead to double code.
Edit 2: When I execute cmd /C clean.bat , Git bash turns into a normal CMD environment and displays only a prompt. The clean.bat file clean.bat not running. This is the same as if I just typed cmd .
Also, adding the /debug switch does literally nothing. It seems that only cmd gets evaluated and all other parameters are ignored.
git windows cmd batch-file
eckes Aug 08 '12 at 13:01 2012-08-08 13:01
source share