java - Relative path not executed in windows registry at startup? -
i want run jar file @ windows startup. made entry @ registry successfully.
the jar file running @ system startup.
but problem is, file running absolute path. sample path follows:
c:\users\...\desktop\jars\myjar.jar
but want run file relative path. developed application in eclipse, , path of "myjar2.jar" , executes within myjar.jar file.
i path of "myjar2.jar" file calling getcanonicalpath() method. in registry , display path follows:
d:\users\...\projectname/jars/myjar.jar //path using getcanonicalpath() method , stored in registry
how run "marjar.jar" @ system startup above relative path.
thanks in advance...
d:\users\...\projectname/jars/myjar.jar
no vaild path, since contains both '/'
& '\'
. eliminate either of those.
to correct '\'
or '/'
in path use this:
string path = <some_path_here>; path = path.replaceall("\", file.pathseparator); path = path.replaceall("/", file.pathseparator);
Comments
Post a Comment