qixiaobin0715 当前离线
上校
@echo off setlocal enabledelayedexpansion set n=0 for /r %%a in (test1.dll test2.dll test3.dll) do ( set /a n+=1 set path!n!=%%~dpa ) pause复制代码
TOP
@echo off setlocal enabledelayedexpansion for /r %%a in (test1.dll test2.dll test3.dll) do ( if exist "%%a" ( if not "%%~dpa"=="%~dp0" ( set str=%%~na set path!str:~-1!=%%~dpa ) ) ) pause复制代码
@echo off setlocal enabledelayedexpansion for /f "delims=" %%a in ('dir /s /b /a-d test1.dll test2.dll test3.dll') do ( set str=%%~na set path!str:~-1!=%%~dpa ) pause复制代码