0

I have a java stand alone application. I build a jar, and I create a .exe file from this jar file.

Then I can start the application by double click on it. Now I need to create a .bat file to close the exe program. Now I build a .bat file like this:

TASKKILL /F /PID easyManagement.exe
pause

the script is executed without error but the program easyManagement is every time on.

EDIT In task manager I can display my program like this: enter image description here

This code:

TASKKILL /IM easyManagement.exe

run without error but the application is on every time.

bircastri
  • 2,169
  • 13
  • 50
  • 119

2 Answers2

0

The keys Ctrl+C and Ctrl+Z will end the running of a batch file. Check out this link: Is there a way to write Ctrl-C in a batch file?

apollosoftware.org
  • 12,161
  • 4
  • 48
  • 69
Winston
  • 38
  • 6
0

You are using a wrong parameter for the taskkill command.
The /PID expects a pid and not the name of the program you want to stop.
Use TASKKILL /IM easyManagement.exe
or TASKKILL /F /IM easyManagement.exe to force the program to stop.
The /F might cause problems in the program you want to stop.

OJBakker
  • 602
  • 1
  • 5
  • 6