I have a batch file which contains:
start "" javaw -jar %CD%\example.jar
If both example.jar and batch file are in the directory without spaces (f.e. ProgramFiles) everything works fine. if these files are in directory with space (f.e. Program files) it cannot access example.jar file. Javaw program writes following: Unable to access jarfile: pathToMyDir\Program
Also tried this
start "" javaw -jar %~p0\example.jar
but result is the same..
any ideas? How to force the system to identify spaces as a part of a dirname?
Put quotes around the path.
Also, you don’t really need to specify the %CD% unless I am misreading. You could just say: