I have created one .jar
file and am able to execute the .jar
from a .bat
file. Please find my TestBatFile.bat
.
@ECHO OFF
start java -jar C:\Users\Karthikeyan\Desktop\TestingJar.jar
Then i created windows service to execute this file using the below command.
C:\Windows\system32>sc create "testservice" start= demand displayname= "MyService" binpath= C:\Users\Karthikeyan\Desktop\TestBatFile.bat
Service has been created successfully. But while am starting the service am getting the below error.
Error 1053: The service did not respond to the start or control request in a timely fashion.
Please find my below java file which i made as .jar
file.
public class TestJarClass {
public static void main(String args[]) {
System.out.println("Service Started....");
}
}