%~dp0 is a placeholder in DOS scripts for the current directory. I would like to pass that as a parameter to a Java application. I need to use this, because the user.dir system properties to not work correctly (there is no additional value in explaining exactly why here).
Anyhow, -Dxxx=%~dp0 works, as long as there is no space in the path.
-Dxxx="%~dp0" does not work and results in a:
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
Anyone got a suggestion on how to pass %~dp0 with spaces to java?