Ok, bat file woes. Heres the question:
If I for instance want a bat file to run ant clean followed by ant jar I write a bat file as such:
Upon running I would expect both to be run one after the other, like any other sane scripting environment. This is not the case here though, only the first line is run. You actually have to prepend them with call!
call ant clean
call ant jar
Without call execution seems to be lost from the bat file and never return.
Now, I do not know precisely why this is, but I have an inkling.
If I use start then an new cmd.exe is opened and the commands are tun in that, this is unideal you would lose your environment variables.
If I don’t use call then I assume that ant doesn’t return in a way that bat files expect even though the process finishes so the bat file just stops because, why not.
Using call seems to make your bat file wait and carry on regardless of return value, and also maintain environment.
Basically I think this might be something to do with the poor quality implementation of processes and threads in nt as opposed to unix.
It feels like nt doesn’t have the tools to really cope with launching processes non concurrently.
Now, I do not know this to be true, it’s just suspicion. But it feels right.
It really feels like win preferring threads over multiprocessing led them down a path where execution had to stop if another bat file was run because there was no concept of passing control back.
The inclusion of the call command feels like a hack added in to navigate around what seems to be a poor architecture leading to less than optimal design choices.
Merveilles is a community project aimed at the establishment of new ways of speaking, seeing and organizing information — A culture that seeks augmentation through the arts of engineering and design. A warm welcome to any like-minded people who feel these ideals resonate with them.