Take the 2-minute tour ×

I want a command to search for a file in a directory and all sub directories in windows, I saw all the Commands but I couldn't find any command to do this issue!

share|improve this question
add comment

2 Answers

up vote 14 down vote accepted

At prompt type:

dir /S /P "Path\FileName"

If you want to save the results in a text file:

dir /S "Path\FileName" > "Path\ResultFilename"

share|improve this answer
If the file is hidden or a system file you might want to also include the /a parameter as well! 8-) –  Richard Aug 18 '10 at 7:28
add comment

use the /b switch to dir to print full path might be helpful. say, C:\ > dir /b /s *file*.*

still, you can filter the result with find or for, and redirect output to file with >filename

share|improve this answer
add comment

Your Answer


