> No way to use etc/shell.init.script ? I've understood this comment now. The best method seems to be to use the pattern of:
set EXTRA_JAVA_OPTS=-Dkaraf.shell.init.script=<commands.txt> -Dkaraf.delay.console=true bin\karaf (or equivalent) Then ensure that the <commands.txt> file ends with "shutdown -f". This seems to work as long as there aren't any errors in the script, if none of the commands return an error. The error handling seems to surround the complete initialisation script execution, so if any exception is thrown nothing further in the script is executed. Starting the script with "shutdown -f 1" seems a sensible precaution to ensure that karaf doesn't hang forever in these circumstances. Anyway, this seems like a pattern than the bin\start & bin\client -f <commands.txt> & bin\stop pattern.
