?FILE(DBGETPROP(table_name,"TABLE","PATH"))is a better way to go given your original criterion that the table is in the dbc and could be opened with dbprofiler!mytable. Your code below assumes that the table is necessarily in the same directory as the dbc, while Yuri's code is more generic since it makes no prior assumptions about where the table must be located.
>IF DBUSED('dbProfiler') > SET DATABASE to dbprofiler > IF !FILE(LEFT(DBC(),RAT("\",DBC()))+"MYTABLE.DBF") > *--Do whatever > ELSE >>