Here is how you extract the various elements from a fully qualified file name:
@echo offset my_file=C:path odir est.xlsfor /F %%a in ('echo %my_file%') do ( echo Drive=%%~da echo Path=%%~pa echo Name=%%~na echo Extension=%%~xa)