Q:

How to make a batch script that finds a file .bat in c recursively?

Im new to batch scripting and im trying to learn how I can make a script that can go recursively through the folders and if its founded give me the path, if not echo a simple message.
i was starting by here:
@echo off
for /f %%f in ('dir bucle.bat /s/b') do @echo %f  %~tf
pause
exit 

but Im kinda stuck.

A:

You are using a for command to process the output of a dir command. Just to found the file, you don't need all this. Simplify
dir c:\bucle.bat /s /b 

This searchs the file, when found shows it with full path and if not found echoes a error message.

