1、 @echo off & setlocal enableDelayedExpansion set a= set /p a=Please drag your txt file for split: cls :: %% Two percent signs without filename suffix for %%k in (%a%) do set wjm=%%~nk 2.
Call call echo %~nx1
set /p a=Please drag your txt file for split:
call :getname !a!
:getname
echo %~nx1