Frank
Frank

Reputation: 31086

How to make a Java app automatically start when PC starts?

I'm developing a scheduling app, it reminds user of things to do during a day, it checks every minute to see if time is up, and if it is it will open an alert window to remind the user. Although it's written in Java, I'm targeting Windows users for this app. It needs to run as soon as users' PCs are turned on, so my question is: How to make a Java app automatically start when a PC is turned on in a Windows system?

I know I can go through a few steps manually to add the app to start-up apps list, but not every user is familiar with the steps, so I wonder if it can do this through my Java program, and if so is there any sample code?

Upvotes: 4

Views: 7379

Answers (2)

KitsuneYMG
KitsuneYMG

Reputation: 12901

create a .bat file

@javaw -jar path/to/jar/Name.jar arguments

drop this in you startup directory

Upvotes: 2

Chandra Patni
Chandra Patni

Reputation: 17577

Use Java Service Wrapper. Set wrapper.ntservice.starttype=DEMAND_START in wrapper configuration.

Upvotes: 2

Related Questions