Windows – can I use CMD to search for files in windows

command linewindowswindows-search

I want a command to search for a file in a directory and all sub directories in windows using the command line. I saw all the available commands but I couldn't find any suitable command to do this operation.

Best Answer

At prompt (Command Line) type:

dir /S /P "Path\FileName"

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

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