回复 3# xxez - @echo off
- set "firstlook=test\folder\myfolder"
- for /f "skip=1" %%i in ('wmic logicaldisk where "drivetype=3" get name') do (
- for /f "delims=" %%e in ('dir /s /b "%%i\%firstlook%\XX.exe" 2^>nul') do (
- set "fullpath=%%~e"
- if exist "%fullpath%" (
- goto :breakloop
- )
- )
- )
- for /f "skip=1" %%i in ('wmic logicaldisk where "drivetype=3" get name') do (
- for /f "delims=" %%e in ('dir /s /b %%i\XX.exe 2^>nul') do (
- set "fullpath=%%~e"
- if exist "%fullpath%" (
- goto :breakloop
- )
- )
- )
- goto :eof
-
- :breakloop
- start "" "%fullpath%"
复制代码
|