Home > other >  Change the title in the cmd prompt using batch file
Change the title in the cmd prompt using batch file

Time:10-20

I created a .bat file which executes multiple calls in different command prompt.

@echo off
title Start multiple services
start cmd /k Call mongod
start cmd /k Call elasticsearch
timeout /t 5
start cmd /k Call kibana
cd "C:\New folder\influxdb-1.7.6_windows_amd64\influxdb-1.7.8-1\"
start influxd.exe
timeout /t 10
cd "C:\App\App1\bin"
start cmd /k node www
cd "C:\App\App2\server"
start cmd /k node server.js
cd "C:\App\App3\server"
start cmd /k node server.js
cd "C:\App\App4\server"
start cmd /k node server.js

the issue what I am facing that for App2, App3 and App4. I am getting the same title "node server.js" in the command prompt which is creating confusion. How could I add different names in the title for these. I tried putting TITLE in the command like start cmd /k TITLE App3 node server.js. But that didn't work.

CodePudding user response:

You can do the same by

START /D C:\App\App2\bin "write your title" cmd /k node server.js

For reference check: https://ss64.com/nt/start.html

  • Related