Is there any command in windows to search a file with filename or pattern.
Just like locate command in linux.
You should be able to do what you need to do with
dir [filename] /s
Replace [filename] with the filename you're looking for, you should be able to use wildcards.
/s makes it search sub-directories so if you need to you can start in the root of C: and have it check the entire drive.
WHERE command is also work like locate.
WHERE [/R dir] [/Q] [/F] [/T] pattern...
WHERE /R C: *.jpg
(It lists all jpg image files inside the all subdirectories of C: drive)
Displays the location of files that match the search pattern.
By default, the search is done along the current directory and
in the paths specified by the PATH environment variable.
/R Recursively searches and displays the files that match the
given pattern starting from the specified directory.
/Q Returns only the exit code, without displaying the list
of matched files. (Quiet mode)
/F Displays the matched filename in double quotes.
/T Displays the file size, last modified date and time for all
pattern Specifies the search pattern for the files to match.
Wildcards * and ? can be used in the pattern. The
"$env:pattern" and "path:pattern" formats can also be
specified, where "env" is an environment variable and
the search is done in the specified paths of the "env"
environment variable. These formats should not be used
with /R. The search is also done by appending the
extensions of the PATHEXT variable to the pattern.
/? Displays this help message.
NOTE: The tool returns an error level of 0 if the search is
successful, of 1 if the search is unsuccessful and
of 2 for failures or errors.
WHERE myfilename1 myfile????.*
WHERE /R c:\windows *.exe *.dll *.bat
WHERE /Q ??.???
WHERE /F /T *.dll