I’m trying to cobble together a script to help me develop / test some code…
How can I call ‘box server start’ say within a batch file (I’m on Windows) and have it run in a different directory?
Basically I have something like:
/test
- test.bat
/wwwroot
- server.json
Within test.bat I want to do ‘box server start wwwroot’ or something like that. So far everything I’ve tried spins up the server in the wrong location 
Jim
you can give the command a direct path to the server.json, i.e.:
box server start /long/path/to/var/www/app/server.json
Hi Jim, sorry for the delay on your message posting. I just got back from vacation and your message was still in the first-post moderation queue.
You have a few options that should work.
- Start the server by name (server start myServer) but note that assumes you’ve already started the server at least once on this machine.
- Start the server by web root (server start directory=…/wwwroot) but note that assumes you only have one server in that directory.
- Start the server by path to the config file (server start …/wwwroot/server.json). This is recommended and the least ambiguous.
https://ortus.gitbooks.io/commandbox-documentation/content/embedded_server/serverJSON/using_multiple_serverjson_files.html
Also note, the server.json file doesn’t need to be in the web root as the json file itself can point to the web root.
https://ortus.gitbooks.io/commandbox-documentation/content/embedded_server/serverJSON/packaging_your_server.html
And finally, to help debug what is happening on your server starts, try adding –debug which will output extra logging that helps show you how and where the web root was decided.
https://ortus.gitbooks.io/commandbox-documentation/content/embedded_server/debugging-server-starts.html
Thanks!
~Brad
ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com