xcopy X:\ "%TEMP%" /H /L /S /Y | find "FileName"
may find multiple files called "FileName" in different folders. You need to decide which one of those you need to copy to a variable. The following set variable FPATH to the last file found:
for /f "delims=" %%a in ('xcopy X:\ "%TEMP%" /H /L /S /Y ^| find "FileName"') do (
By the way, instead of using "find", the following command is a bit faster:
xcopy "X:\FileName" "%TEMP%" /H /L /S /Y
Also, the following command is even faster still:
dir /s /b "X:\FileName"