1

I have an application which has a purpose to run when the user first runs their computer.

However, I'd like to make a check box on the app that enables/disables the application loading when the system is started. Is there any way to do this?

Thanks

Tim
  • 1,056
  • 4
  • 17
  • 34

2 Answers2

1

I recommend you to create a service under windows. My suggestion is http://winrun4j.sourceforge.net/

nexus
  • 2,937
  • 3
  • 17
  • 22
1

This question has been discussed in SO time ago:

Code for Auto starting a java application on windows startup

Auto startup for java desktop application?

However, maybe the easier solution is to create a batch file,like suggested in the first link, to run your application as the user logs in.

If you want to enable/disable the startup through a checkbox, the first and simplest solution that comes to my mind is this: you can make a method, invoked by the checkbox listener, that edits the batch file and enables/disables the line used to run the application, in the batch file.

If you have Windows 7, read this tutorial.

Community
  • 1
  • 1
Alberto Solano
  • 7,972
  • 3
  • 38
  • 61