Reputation: 369
I would like to know how to create a bat file that changes directory and start activator
I tried without success..
cmd /k cd c:\Users\user\project & activator -jvm-debug 9999 run
cmd /k cd c:\Users\user\project && activator -jvm-debug 9999 run
cmd /k cd c:\Users\user\project ; activator -jvm-debug 9999 run
Upvotes: 0
Views: 347
Reputation: 7921
cmd /k
will run cd c:\Users\user\project
and immediately to the cmd prompt. So the second part activator -jvm-debug 9999 run
will never run.
You need to remove cmd /k
from your batch file.
Use instead the following batch file:
@echo off
cd c:\Users\user\project && activator -jvm-debug 9999 run
cd c:\Users\user\project
activator -jvm-debug 9999 run
Note activator
must be in %path%
for this to work.
Source cmd
Start a new CMD shell and (optionally) run a command/executable program.
Syntax
CMD [charset] [options]
CMD [charset] [options] [/C Command]
CMD [charset] [options] [/K Command]
Options
/C
Run Command and then terminate
/K
Run Command and then return to the CMD prompt. This is useful for testing, to examine variables
Source Redirection
commandA && commandB
RuncommandA
, if it succeeds then runcommandB
Upvotes: 1