WHERE (Windows 2003 + )

Locate and display files in a directory tree.

The WHERE command is roughly equivalent to the UNIX 'which' command. By default, the search is done in the current directory and in the PATH.

      WHERE [/r Dir] [/q] [/f] [/t] Pattern ...

      WHERE [/q] [/f] [/t] [$ENV:Pattern

   /r      A recursive search, starting with the specified Dir directory.

   /q      Don’t display the files but return either an exit code of 0 for success
           or 1 for failure.

   /f      Display the output file name in quotation marks.

   /t      Display the size, time stamp, and date stamp of the file.

  pattern  The Drive\Directory\file, or set of files to be found.
           you can use wildcard characters ( ? * ) and UNC paths.

   ENV     Path to search where ENV is an existing environment variable containing one or more paths.

By default, WHERE searches the current directory and the paths specified in the PATH environment variable. Optional search paths (in pattern) should not be used in conjunction with /r Dir.


Find all files named 'Zappa' in the current system path


Find all files named 'Zappa' on the remote computer 'Server64' searching its subdirectories:

WHERE /r \\Server64\Share1 Zappa.*

“Who never walks, save where he sees men's tracks, makes no discoveries” ~ Josiah Gilbert Holland


Which.cmd - Show full path to executable.
whereis utility - Flounder.com
Which - Rob Vanderwoude (Batch/Perl/VBScript)
OldNewthing - which batch file + discussion
CD - Change Directory
TYPE - Display the contents of a text file
Equivalent bash command (Linux): which - Show full path of commands
Equivalent PowerShell cmdlet: (get-command $file).Definition

Copyright © SS64.com 1999-2018
Some rights reserved