Running a Java process in Windows even after the user is logged out

Posted by Mani on Stack Overflow See other posts from Stack Overflow or by Mani
Published on 2009-02-16T12:33:09Z Indexed on 2010/03/28 21:03 UTC
Read the original article Hit count: 241

Filed under:
|
|

I have a batch file that starts a Java process in a Windows 2003 server. As per the security policy, the users of that machine are logged off forcefully, if the user is inactive for a certain period of time. The problem is that when the user is logged out, the process also dies.

I scheduled a new task (Control Panel -> Scheduled Tasks) and selected the option of 'When my computer starts' and gave the user account details there. But it doesn't seem to have any effect, the user is still logged out and the process dies. Is a reboot necessary to make this change effective? And after the reboot, will I achieve what I'm expecting (keeping the process alive)?

Alternatively, will running this process as a Windows Service solve the problem? If so, can you please let me know how I can make a Java program or a batch file to run as a Windows Service? I would prefer not to use any other third party tools or libraries.

Thanks

© Stack Overflow or respective owner

Related posts about java

Related posts about windows-services