avinandan012
avinandan012

Reputation: 153

launch a cmd window with changed color and execute a jar file from a batchfile

I am trying to create a *.bat file which runs a jar file and shows the console using 'cmd.exe'. But I want it in matrix like theme i.e. Black Background with green text. But I am unable to create this. I tried few options most does not work, those which works starts cmd prompt in a infinite loop keep on creating cmd windows.

This is the initial file.bat which works fine with default colors.

 start java -jar MainMenu.jar 
 exit

This is one which changes the colors but keep on creating cmd windows

start /B cmd /k "COLOR 0A&&java -jar MainMenu.jar"
exit

How to achieve this?

Upvotes: 3

Views: 981

Answers (1)

VishalDevgire
VishalDevgire

Reputation: 4278

Worked on my machine, i just had to add a pause to see the effects:

color 0a
java -jar launcher.jar
pause

Upvotes: 1

Related Questions