Caffeinated
Caffeinated

Reputation: 12484

In Windows, how would I create a batch file that opens 2 command windows with a specific Java program?

I am trying to create a batch file that will reopen my KnockKnockClient and KnockKnockServer programs , get them started.

So far , my batch file looks like this :

@echo off
setlocal


start cmd

start java KnockKnockServer

ping 192.0.2.2 -n 1 -w 5000 > null

start /wait java KnockKnockClient

if errorlevel 1 goto retry

echo Finished successfully
exit


:retry

Also, suppose that I want it to restart so that the CMD window with the KnockKnockClient is active. Is that possible ?

any tips appreciate, thank

Upvotes: 0

Views: 20

Answers (1)

mahinlma
mahinlma

Reputation: 1258

"start" itself invokes cmd.

you don't need to give "start cmd"

Maybe your directory path should be varied. (locate correct path of your program)

Upvotes: 1

Related Questions