luckasx
luckasx

Reputation: 369

Start Activator using cmd

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

Answers (1)

DavidPostill
DavidPostill

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
  • This will run the the first command cd c:\Users\user\project
  • If the first command succeeds it will then run the second command 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 Run commandA, if it succeeds then run commandB

Upvotes: 1

Related Questions