Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

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

 
discard

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.