mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 00:49:28 -05:00
27 lines
355 B
Batchfile
27 lines
355 B
Batchfile
|
:: Usage:
|
||
|
:: call find-in-path.bat variable file
|
||
|
|
||
|
setlocal
|
||
|
|
||
|
set Var=%~1
|
||
|
set File=%~2
|
||
|
|
||
|
if "%File%"=="" (
|
||
|
echo.
|
||
|
echo Parameter error.
|
||
|
exit /B 1
|
||
|
)
|
||
|
|
||
|
set FoundPath=
|
||
|
|
||
|
SET PathTemp="%Path:;=";"%"
|
||
|
FOR %%P IN (%PathTemp%) DO (
|
||
|
IF EXIST "%%~P.\%File%" (
|
||
|
set FoundPath=%%~P
|
||
|
goto :found
|
||
|
)
|
||
|
)
|
||
|
|
||
|
:found
|
||
|
endlocal & set %Var%=%FoundPath%
|