I am trying to run springboot jar as window service and i was able to do using below script. It generates two process prunsrv.exe and java.exe. But on stopping the service it only stops prunsrv.exe(using //SS//Myservice) but i can see java.exe process still running which i have to end using task manager only. How to stop both the process at a time such that i dont have to search processin taskmanager to kill?
set "CLASSPATH=D:\temp-1.0.0.jar"
prunsrv.exe //IS//%SERVICE_NAME% ^
--Description "Myservice" ^
--DisplayName "%DISPLAYNAME%" ^
--Install "%EXECUTABLE%" ^
--LogPath "D:\MyService" ^
--Startup auto ^
--StdOutput auto ^
--StdError auto ^
--Classpath "%CLASSPATH%" ^
--Jvm "%JVM%" ^
--StartImage "%JAVA_HOME%\bin\java.exe" ^
--StartMethod start ^
--StopMethod stop ^
--StartMode exe ^
--StopMode java ^
--StartPath "D:\MyService" ^
--StopPath "D:\MyService" ^
--StartClass com.darth.MyService ^
--StopClass com.darth.MyService ^
--StartParams -jar#%CLASSPATH% ^
--StopParams stop ^
--JvmMs 1024 ^
--JvmMx 6144