954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Run jar at windows startup?

I recently wrote a java jar file that takes the current date and time and puts it into a text file. What i want to do is put this into a users startup folder so i know when they got on to the computer. However, if the jar is in the folder nothing happens. If i put a .bat file in the folder with the code

javaw -jar LoginLogger.jar

it gives me an error saying that LoginLogger.jar could not be accessed. But if I double click the bat it works fine. Just not at startup. Does anyone know whats wrong with this setup?

Bubbleboy
Light Poster
25 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

Add a MORE statement at the end of the bat file to hold the console open to see if there are any more error message. Also try it with the java command vs javaw

NormR1
Posting Expert
Moderator
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
 

Another idea. Try using a full path to the jar file.

NormR1
Posting Expert
Moderator
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
 

First off, I tried all the things you suggesting including a full path. I have been using javaw (as its supposed to be a secret program) but i tried with java and the same thing happens. I added more to the bat and nothing changed. I wonder if its starting before the jvm?

Bubbleboy
Light Poster
25 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

I use shortcuts to start many of my jar apps. Some I created by RC on the jar file and select "Create shortcut". Others that need custom commandlines, I copied from somewhere long ago and modify the Target: and Start in: entries.

I copied one into the Startup folder and the app was started at system boot time.

NormR1
Posting Expert
Moderator
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
 

Thank you so much! I created a shortcut to the jar and it worked fine! I now know the time and dates that my brother logs into the computer. Mwahahahaha!!! Nonetheless, thank you for your quick replies and assistance.

Bubbleboy
Light Poster
25 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: