You can use p4 wheredepot to convert local file specifications to convert files.
To analyze the output p4 wherefrom a Windows batch file, the following may help:
for /f "tokens=3" %%i in ('p4 where %my_depot_filespec%') do echo %%i
, for , , p4 where. , .