Im making a basic .bat file that runs the application. This is to get auto startup feature.
However for some reason System.getProperty("user.dir")
does not always get the correct path to the program.
Basically i am saving this to the .bat file:
protected final String fileSeparator=System.getProperty("file.separator");
out.println("@echo off");
out.println("start " + System.getProperty("user.dir") + fileSeparator +"App.jar");
out.println("exit");
On Windows server it returns the correct path but on Vista it does not.
Any ideas how i could get this to work on all versions of Windows?