Closing a java console from windows command prompt
13 replies, posted
I'm trying to close a minecraft server from cmd and I noticed there is no cmd.exe process in task manager for the server's console window (its running on no gui mode so it has a cmd window for console)
So using "taskkill /f /fi "WINDOWTITLE eq Minecraft Server" /im cmd.exe" won't work. Closing down java.exe will shut down the server. But I have another java process running and I only want to shut down the server.
I tried the previous command with /im java.exe too but that didn't work. The console window of the server has absolutely no process tied to it. Pressing "Go to Process" from task manager on the window displays nothing.
So is there any way to shut it down from cmd?
[editline]asd[/editline]
iirc there was a way to see the "command" that was used to start the java process (like in linux process list) but I dunno if its possible to use that to filter the specific java.exe process to close
Command line applications run with conhost.exe, cmd.exe is just the command line interpreter.
You can filter by module, maybe there's one that only Minecraft loads.
Other than that, why can't you just kill by window title and ignore the exe name?
[QUOTE=Tamschi;42357954]Command line applications run with conhost.exe, cmd.exe is just the command line interpreter.
You can filter by module, maybe there's one that only Minecraft loads.
Other than that, why can't you just kill by window title and ignore the exe name?[/QUOTE]
damn, i didn't realise that was possible
thanks
Never mind, that doesn't work after all
I have the server console with the window title "Minecraft Server"
When taskkill /f /fi "Windowtitle eq Minecraft Server" is executed it says program with pid xxxxx has been closed but the server and the console remains open.
If the close command is executed again after it it says program not found even though the console window titled Minecraft Server is right there.
Don't [i]ever[/i] use command prompt.
Either install Linux or use [url=http://www.cygwin.com/]Cygwin[/url]
[QUOTE=cheesy_lard;42373167]Don't [i]ever[/i] use command prompt.
Either install Linux or use [url=http://www.cygwin.com/]Cygwin[/url][/QUOTE]
cygwin is not a command prompt replacement
[QUOTE=supersnail11;42373385]cygwin is not a command prompt replacement[/QUOTE]It kinda is
[QUOTE=cheesy_lard;42373167]Don't [i]ever[/i] use command prompt.
Either install Linux or use [url=http://www.cygwin.com/]Cygwin[/url][/QUOTE]
Thats not possible in this case
Anything is possible with Linux.
[QUOTE=cheesy_lard;42451573]Anything is possible with Linux.[/QUOTE]
This isn't really helping.
[QUOTE=Tamschi;42357954]Command line applications run with conhost.exe, cmd.exe is just the command line interpreter.
You can filter by module, maybe there's one that only Minecraft loads.
Other than that, why can't you just kill by window title and ignore the exe name?[/QUOTE]
How do i filter by module?
[QUOTE=TNOMCat;42573282]How do i filter by module?[/QUOTE]
With /FI MODULES eq/ne.
Read taskkill /?
[editline]19th October 2013[/editline]
However, the most reliable way would be to load a Minecraft mod that can gracefully shut down the server once a condition is reached.
[QUOTE=Tamschi;42573310]With /FI MODULES eq/ne.
Read taskkill /?
[editline]19th October 2013[/editline]
However, the most reliable way would be to load a Minecraft mod that can gracefully shut down the server once a condition is reached.[/QUOTE]
How do I get a list of modules for a process? taskkill help didn't say anything about it other than the possibility of using them as filter
[QUOTE=TNOMCat;42579534]How do I get a list of modules for a process? taskkill help didn't say anything about it other than the possibility of using them as filter[/QUOTE]
tasklist /M /FI "IMAGENAME eq javaw.exe" should work.
You can check with for example tasklist /M /FI "MODULES eq framedynos.dll" if there are any other processes with that module.
I think you can combine filters if there's no one module that precisely matches the server.
Sorry, you need to Log In to post a reply to this thread.