Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 27 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

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.