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