Andrea Stella
Andrea Stella

Reputation: 83

Set a program to run on windows startup from inside the program

I'm working on a Java program and I would like to know how to set the program to run when windows is started from inside the program. Right now I have a config menu that has a checkbox with "run on windows startup", I need to create a class that, if the value saved in my config file equals 1, adds the .exe of the program to the "start at windows startup" list and if it equals 0 removes it. Searching on the internet yielded no decent results.

I thank you for the help! :)

Upvotes: 0

Views: 59

Answers (1)

alturkovic
alturkovic

Reputation: 1140

I am not sure if it will work, you could try to create a .bat file under %appdata%\microsoft\windows\start menu\programs\startup\ with: java -jar PATH_TO_JAR

Upvotes: 1

Related Questions