cmd 获取 拖拽文件名

1、
@echo off & setlocal enableDelayedExpansion
set a=
set /p a=Please drag your txt file for split:  
cls
:: %% 两个百分号 不带文件名后缀
for %%k in (%a%) do set wjm=%%~nk

2、 
调用call echo %~nx1

set /p a=Please drag your txt file for split:

call :getname !a!
:getname
echo  %~nx1

  

猜你喜欢

转载自www.cnblogs.com/cbugs/p/8994107.html