to be brief - I have written a small Parser.class in Java and to it a small batch script that executes the command: java Parser "%1" The idea is that I want to drag-drop logfiles onto the batch script, which would then be handed over to my class as arguments. So far everything works fine if I put the logfile in the same folder as the batch script and java class. However, if the logfile is e.g. on the Desktop and I drag it directly onto the batch file in another folder, I receive the error that the main class Parser couldn't be found or loaded. Any idea what might be wrong here? I want to make it possible to drag the logfiles from any location onto the batch.
Edit: This is my batch-script:
@echo off&&setLocal EnableDelayedExpansion
if "%1"=="" (
echo Please drag your file onto the icon.
echo.
pause&&goto :eof)
cls
java Parser "%~1"
Any idea what to do now? The problem with the spaces in the filepath should be avoided using "~", and as I said my batch script works as expected when all files are in the same folder...