0

i want to kill a java process through a batch file, but safely.

The problem is, when i use

taskkill /IM java.exe

it wont kill the process because java doesn't allow it.

When i use

taskkill /F /IM java.exe

it works, but there is the risk that files could corrupt, so i don't want to use it.


The subject is to stop a minecraft server which is running on windows. One option on linux is to use screen so i can send a stop-command to this virtual command line but as i know this programm doesn't work on windows. Is there mayby an alternative?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
K. Miller
  • 51
  • 1
  • 7
  • 1
    Your question is technically not suitable for StackOverflow, because here we help you to fix a specific replicable issue with your provided code. You don't have a code issue, you're really looking for reference material on alternative methods of performing a task. I'd suggest deleting the question and posting instead on [Super User](https://superuser.com/questions/ask). – Compo Aug 19 '18 at 18:41
  • Additionally, tag your question correctly. [minecraft] isn't relevant to your question, as you are not making a mod or plugin. – Draco18s no longer trusts SE Aug 20 '18 at 02:23
  • it is safe to use `taskkill` for local processes as long as you do NOT force it with `taskkill /f` extract of the documentation: __/f : Specifies that process(es) be forcefully terminated. This parameter is ignored for remote processes; all remote processes are forcefully terminated.__ – Gerhard Aug 20 '18 at 08:03

0 Answers0