By batch Script execute command to start (IBM liberty web) server and then Launch Default Browser with URL

My own batch script is Myscript.bat which is in folder D:\. There is a batch file named server.bat which is located at D:\wlp\bin for starting (IBM liberty web) server. And I use the command D:\wlp\bin>server start defaultServer. I want to start the server by clicking Myscript.bat and then want to display a message "Loading Completed" and the automatically a default browser with URL http://localhost:8080/Demo. But after starting the server I am not able to display message  or launching browser. Please suggest what needs to change in my code.(I am not allowed to look into code of server.bat, so it should not be touched)

Myscript.bat contains-

@echo Starting script
@echo Loading Liberty Profile. This may take some time ...
@cmd /k "%~dp0\wlp\bin\server.bat" start
echo Loading completed
start http://localhost:%NewPort%/HatsDemo
@pause

Command Prompt Screenshot:

D:\wlp\bin>server start defaultServer
Starting server defaultServer.
Server defaultServer started.

D:\wlp\bin>
Aryabhatta MAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NVITEnd-user supportCommented:
Try changing...
@cmd /k "%~dp0\wlp\bin\server.bat" start

Open in new window


...to
@cmd /k call "%~dp0\wlp\bin\server.bat" start

Open in new window

0
Aryabhatta MAuthor Commented:
@cmd /k call "%~dp0\wlp\bin\server.bat" start is producing same effect as @cmd /k "%~dp0\wlp\bin\server.bat" start. After starting server prompt is returning without showing message or launching browser.
0
NVITEnd-user supportCommented:
Sorry, should be...
call "%~dp0\wlp\bin\server.bat" start

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bill PrewIT / Software Engineering ConsultantCommented:
Please try below script.

Where is NewPort variable assigned, does that happen in server.bat?

@echo off
echo Starting script
echo Loading Liberty Profile. This may take some time ...
call "%~dp0\wlp\bin\server.bat" start defaultServer
echo Loading completed
start http://localhost:%NewPort%/HatsDemo
pause

Open in new window


»bp
0
Aryabhatta MAuthor Commented:
Yep this works
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.