Startup.bat is dependent on two env variables: CATALINA_HOME and JRE_HOME (or JAVA_HOME).
You must have either JRE_HOME or JAVA_HOME set, otherwise you would not be able to run startup by double clicking.
This leaves us with CATALINA_HOME. Startup script will try to guess it if it's not set, but this works only if it's executed from it's current directory (or it's parent to be precise). If you try to run it from other directory and CATALINA_HOME is not set it will fail (with a message about it).
If that's your issue you should see similar message at the top of cmd window:
The CATALINA_HOME environment variable is not defined correctly This
environment variable is needed to run this program
Another issue you may run into is when your path contains spaces. It looks yours does not, but it still may be usefull to others, so I will include this piece of info.
When your command includes spaces, you need to quote your
start command, right? This should do:
"cmd.exe /c start \"my path to tomcat bin/startup.bat\""
Wrong. You end up glaring at command window titled my path to tomcat bin/startup.bat
start takes first quoted argument as title... how nice. Correct form is:
"cmd.exe /c start \"\" \"my path to tomcat bin/startup.bat\""
both of those issues will actually stop Tomcat window from appearing at all - you say it closes, so it does start and then dies. Hmm... this is most likely because there is already a process listening on port 8080. Maybe your java IDE starts Tomcat? Or starts another server listening on 8080?
If's that's the cause, you should see similar line in Tomcat log (they are stored in
java.net.BindException: Address already in use: JVM_Bind
If that's your issue, than you either need to stop first instance, or reconfigure your server processes so each listens on different port.
Note: I used following to start Tomcat from java, works fine for me:
r.exec("cmd.exe /c start startup.bat", //path to executable
null, // env vars, null means pass parent env
new File("my path to tomcat/bin")); // working directory