When a file, along with relative path or full path..., is given as a parameter of a batch, I know how to expand %1 to get the file name
%~n1
... echo %%~nx set filetxt=%%~nx)
should cure your problem.
or use ~nxx if you want the extension too.
~nxx