I am attempting to write a simple batch file to build a gulp
project and a maven
project.
The current file follows:
cd C:\my\file\path
cmd /k gulp maven-deploy-local
cd C:\my\file\path\two\project-pom-parent
cmd /k mvn clean install -Dmaven.test.skip=true
Whenever I run this script, the command line stops after line 2 and before line 3. I end up looking at this line in cmd
with a blinking cursor:
C:\my\file\path>
If I run the file without the cmd /k
(as follows) then the prompt simply closes after line 2 and before line 3.
cd C:\my\file\path
gulp maven-deploy-local
cd C:\my\file\path\two\project-pom-parent
mvn clean install -Dmaven.test.skip=true
How can I modify the batch script so that it will continue and execute the commands on lines 3 and 4 and then remain open with the following line and blinking cursor?
C:\my\file\path\two\project-pom-parent>
I am operating on Windows 7 64-bit
This task is specific enough to use this as well:
cd /d "C:\my\file\path"
cmd /c gulp maven-deploy-local
cd /d "C:\my\file\path\two\project-pom-parent"
cmd /k mvn clean install -Dmaven.test.skip=true
In essence the first cmd /k
can be changed to cmd /c
so it executes the command and continues to the last command, which leaves the prompt open.
@ECHO OFF
IF NOT "%1"=="1" CMD /K ""%~f0" 1"
CD /d C:\my\file\path
CALL gulp maven-deploy-local
CD /d C:\my\file\path\two\project-pom-parent
CALL mvn clean install -Dmaven.test.skip=true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With