Is there a way to run MinGW, from msys.bat or any other method, from a batch file and input a .sh file for it to run?
Batch file like this
C:\MinGW\msys\1.0\bin\sh ~/test.sh
pause
Related
I have made a batch script to run some .exe files and .bat files. The format of the script is as follows:
a.exe
b.exe
c.bat
d.bat
e.bat
f.exe
g.exe
but the problem is when I run the script it is only executed till c.bat. d.bat is not executing. Is there any problem in writing the batch script for executing other batch files?
just in case you missed the full application of call
a.exe
b.exe
call c.bat
call d.bat
call e.bat
f.exe
g.exe
is how your script should now look.
if you use the 'call' command, the batch files next batch/exe file wouldn't execute unless the batch file stops. Instead, use the 'start' command. that way, it'll execute the batch in a new window
I am trying to execute a .bat file with Ruby using:
System("path\to\.bat")
However, I would like to pass parameters to this file. Is this possible?
Just pass them as you would do it normally.
`path\to\.bat -some=flag another-way`
I am getting this error "rem:command not found" in my batch file. Other dos commands (e.g. echo) are also not found.
My makefile is calling this batch file. This works previously when I am using cygwin. But when I changed to MSYS, I am getting this error. Anyone know why this is?
I am using MSYS version 1.0.17 on a Windows pc. But, I did not install Mingw. Should i install it also?
It looks as though you are trying to run a "Batch" file using Bash. This will not work. While Batch file interprets rem as a comment, Bash simply thinks it is a command and tries to run it.
My suggest would be to rewrite it as a Bash script, perhaps this could be a starting point.
After trying with cmd //c [path_to_bat file] it works for me.
This is because mingw cannot run *.bat file directly after running *.bat file with cmd it works.
I found following mail thread about this type of issue
https://lists.gnu.org/archive/html/help-gnu-emacs/2003-10/msg00323.html
I am using 7zip to pack an installation (im using 7z because i need it to work in linux and windows).
From what i've been reading the config.txt file can contains this:
;!#Install#!UTF-8!
RunProgram="Installer.exe"
;!#InstallEnd#!
But what if i need to run another exe before or after running installer.exe? Is it possible like it is in NSIS?
You can specify another progrem in 'RUnProgram' config parameter. Lets say its some .bat file. At the moment program is run, files are already extracted at TEMP location. As your .bat will run then, it can call Installer.exe once script is finished preparations.
When I execute a .bat script from bash in Cygwin, by what mechanism is it running? I understand that if I run a .EXE it will launch, regardless of whether the .EXE is from Cygwin or from a more traditional environment. I understand that when I execute an executable script with #! at the beginning that Cygwin supplies the magic for it to run.
But why does a .bat script work? Is there some component inside of Cygwin that is aware of what a Windows .bat script is and what to do with it? Or is it that it is somehow impossible under Windows to execute a call to launch a .EXE file that won't automatically also work for a .bat script instead?
Running
./test.bat params
from bash seems to be equivalent to
cmd /c test.bat params
I believe that bash in cygwin sees the bat extension as being flagged executable (a cygwin hit-tip to windows convention). As such it loads and executes the file with it's associated interpreter (cmd.exe, per os configuration), much as it creates a new instance of bash to run your #! scripts (per posix standard).
And if you want to fork an *.cmd file execution like a ShellScript process and append his log to an file:
cmd /c test.bat > nohup.out &
Enjoy!