Here is an update
Thanks everyone. With what Greg posted I was able to get exactly what I needed. It may not have been as dynamic as I dreamed of, but it certainly solved my problem.
The total objective was to find and remove all locations of a program installed on a work station and update to the latest version and in only one standardized location. The program has been install in several locations and in several releases, major an minor. I could find each installation using the "whereis.bat" at
http://garbo.uwasa.fi/pub/pc/link/tscmd.zip and
http://www.netikka.net/tsneti/info/tscmd.php. Each install location had two files I needed at two different locations so i used Greg's script twice. The %%g %%h were needed because of a space in the location, path, that create two tokens. The return from whereis.bat was parsed to strip out the path and the results stored in justpath.txt and instlogpath.txt. I set up if statements to hand those rare cases where the number of installations exceeded three.
set /a c=0
setlocal enabledelayedexpansion
setlocal enableextensions
echo.
rem File 1 search
set /a c=0
set locfile=justpath.txt
FOR /F "tokens=1*" %%g in (%locfile%) do (
set /a c+=1
if !c!==1 ( set File1Line1=%%g %%h )
if !c!==2 ( set File1Line2=%%g %%h )
if !c!==3 ( set File1Line3=%%g %%h )
)
rem File 2 search
echo.
set /a c=0
set locfile=instlogpath.txt
FOR /F "tokens=1*" %%g in (%locfile%) do (
set /a c+=1
if !c!==1 ( set File2Line1=%%g %%h )
if !c!==2 ( set File2Line2=%%g %%h )
if !c!==3 ( set File2Line3=%%g %%h )
)