I'm late on this but, complementing Andriy answer, you can streamline the BAT by combining two FOR loops, which might be slightly more efficient, and more clear.
for /D /R %%d in (*) do (
pushd %%d
for %%x in (*.dat) do tool.exe -c -f -e "%%x"
popd
)
As an added bonus, this version will solve the case when the main loop refers to a different drive (which is not the case on this particular OP question) and has the relative side value of restoring the current directory on each iteration, which might also be of slight importance in case other commands are incorporated in the loop.