skeletonchoji
skeletonchoji

Reputation: 31

Cmd window to close after opening process with .bat

I'm new with batch file and the code I'm using I had to find but it always opens cmd but doesn't close it after the program is open. I'm aware that it doesn't close because it's a window process and cmd doesn't close until after the window is closed. I would like to to close after it opens the window. Here is the code:

"C:\Program Files\Java\jre7\bin\javaw.exe" -Xmx1G -Xms1G -jar "Minecraft_Server.exe"

I've used many different ways close it like putting Exit at the end or putting cmd /c in front but that didn't work.

Upvotes: 1

Views: 2017

Answers (1)

Silvermind
Silvermind

Reputation: 5944

Update

The start command does not seem to work with multiple parameters. Only solution I could come up with is creating a windowless executable that handles the executing with multiple parameters.


Original answer

I've tested the following and it works because Progra~1 is the a conversion of the Program files folder in oldskool 8 character style:

start c:\Progra~1\Intern~1\iexplore.exe -new -k "http://www.google.com/"

I cannot verify this because I do not have java, but it should work:

start C:\Program~1\Java\jre7\bin\javaw.exe -Xmx1G -Xms1G -jar "Minecraft_Server.exe"

However if more folders start with Progra then it could also be Progra~2, Progra~3 etc. You would have to try what works.

Upvotes: 1

Related Questions