Reputation: 3740
OK, so I want to run my whole working environment from a batch file...
what I would like to achieve...
Hope it makes sense... I tried this in my run-work.bat
cd C:\xy
code .
node .
cd C:\xy-app
code .
ng serve
it stops after running the first code .
so the node .
does not get executed
any ideas?
I want to run all commands listed in succession! Possibly terminating in 5 windows open.... powershell 1 (with node server running) powershell 2 (with angular app running) vscode 1 (with API app), vscode 2 (with Angular app) and a chrome window
Upvotes: 3
Views: 10554
Reputation: 38
@echo off
echo Welcome to Electrofixes
pause
cd C:\Users\skshr\Desktop\medical_science
ng serve --port 4200 --open
pause
Upvotes: 1
Reputation: 61
Try this:
start /min cmd /c "cd C:\{path to angular project} && code . && ng serve --port 4200 --open"
start /min cmd /c "cd C:\{path to express project} && code . && npm run dev"
/min to open cmd minimized. This will open 4 windows i.e a cmd with angular app, a cmd with node server, a vs code with angular app and a vs code with api app.
--open
after ng serve
with open browser after it has finished building.
Upvotes: 4
Reputation: 41581
Save this in a bat file
d:
cd ......
code && npm start
In your package.json
specify -o
to automatically launch in browser as below
"start": "ng serve -o -w",
Upvotes: 2