@echo off :NT echo Running under NT or 2000 or XP ::Get the current batch file's short path for %%x in (%0) do set BatchPath=%%~dpsx for %%x in (%BatchPath%) do set BatchPath=%%~dpsx :TEST echo starting program %0 echo This is your current path %BatchPath echo staring server on port %1 java -Djava.security.policy=java.policy -Djava.rmi.server.codebase=file:/%BatchPath%/malefiz.jar -cp "malefiz.jar" bootstrapserver.BootstrapServer %1 END :ERROR echo Insert error-handling code here goto DONE :DONE