Whereis for Windows

The Whereis utility script is a handy tool for finding the location of a program or showing duplicate copies of system tools and batch files.

Readers

May 6, 2002

1 Min Read
ITPro Today logo in a gray background | ITPro Today


Where did the Whereis command of yesterday go? A little innovative use of Windows 2000's lesser-known shell capabilities makes the recreation of this utility simple. The Whereis utility script, which Listing 1 shows, finds the location of a program whose name you type at the command line. The script also shows duplicate copies of system tools or batch files that have the same name as a program that you're trying to execute. The script, which works similarly to UNIX's Which command and DOS's whereis.exe command, not only finds the command that executes when you type it at the command line but also finds any other commands on the path that are potential collision victims (i.e., an executable that might run when you intend to run a batch file of the same name). This script works in Windows XP, Win2K, and Windows NT.

—Kevin Gould
[email protected]

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like