I have a batch file login.bat that contains
java -jar D:/ERPLogin/Login.jar
The above code runs when the system starts it automatically running the my application. Similarly when user click the shutdown button from windows before run my application then system shutdown immediately with out user interface