Is there a way to read a file from a network shared location on windows?
Let\'s say for instance I\'ve this simple code that reads a text file called rea
In your bat file %~dp0 expands to the location of the bat file. You need that in your classpath so that java can find the class, though I don't know if it will choke on UNC path. For example:
@echo off
echo %~dp0
would output
\\host\share\dir
EDIT: %dp0 will not work if there are spaces. This is what you need in your bat file:
@echo off
set p=%~dps0
echo %p%
java -classpath %p%\jarname classname
pause