Bat to terminate process and close app on desktop

2

In the company I work with we have an application called Socket developed in Java to run files in the browser, but I need a bat to kill the process and close the application icon and start it again, but it will not accept 2 socket open, I have managed to do so that kills the process and starts it again, but when it starts from the error of getting two socket open, I need a bat that closes the icon and when boot open again, that icon is next to the bar tasks next to the speaker, I hope I have explained correctly.

@echo off
taskkill /F /IM conhost.exe (nome do processo)
C:\SOCKET\ExecuteAppCaixa.jar (caminho para abrir)
pause

    
asked by anonymous 31.01.2017 / 14:08

1 answer

1

Actually there are two processes that are open on the clock side, but the Explorer that keeps the icons as if the two are open, but in fact only one.

So far the only way to make the process icon that is no longer active disappear is by placing the mouse pointer over the icon or restarting Explorer with the following commands:

taskkill /F /IM explorer.exe
explorer.exe

or just:

tskill explorer
  

Note: In your file you have the command pause that causes the user to press any button to exit the screen, if you want to put the command to execute by a scheduled task or even manually without that it is necessary to see the return of each command, it would be nice to remove pause so that the screen is not open, if it is running in the task scheduler hidden from the user the cmd.exe process will be opened without necessity.

    
31.01.2017 / 14:15