How would you find the current directory which the CMD is currently in from a java file which has been exported and converted into a .exe file.
I'm not looking for the current working directory as that only gets me the location of the .exe file.
System.getProperty("user.dir")
is not what I'm looking for.
Same with new File(".")
If the cmd is C:Users/User/Desktop
and I then call file.exe
, I would like to know the path C:Users/User/Desktop
, not the directory of the file.exe
.
I convert the Main.java file to an .exe by: (Using Eclipse) Export as a Runnable Jar File a s file.jar
Launch4j - Outputfile = file.exe - Jar runtime path = Jars/file.jar - Don't wrap jar, launch only