:InPath [In]Path [Out]0/1
SETLOCAL
SET LocalPathCopy=%PATH%
SET Result=0
:WHILE
IF "%LocalPathCopy" == "" GOTO WEND
FOR /F "delims=;" %%I IN ("%LocalPathCopy%") DO (
IF /I "%%~I" == "%~1" (
SET Result=1
GOTO WEND
)
)
FOR /F "delims=; tokens=1,*" %%I IN ("%LocalPathCopy%") DO (
SET LocalPathCopy=%%~J
)
GOTO WHILE
:WEND
:InPathRet
ENDLOCAL SET %2=%Result% GOTO :EOF