Where to download "where.exe" tool for Windows XP?

Solution 1:

After much Googling, I found all versions of where.exe available as below

  • For Windows 2000
    Pick ‘Windows 2003 32bit sp2 SE’ at dllexedown.com (URL below)

  • For Windows XP-7
    Pick matching download at this same URL, below:

http://dllexedown.com/bbs/search.php?sfl=wr_subject&sop=and&mininum=0&maxnum=10000&stx=where.exe


where /? tells you all you need to know.

The downloaded where.exe can go anywhere in %path%. If you download it to N:\some_folder add N:\some_folder to path, like this: N:\some_folder\>path %cd%;%path% Enter

start /max cmd /k to ‘spawn’ a window with new %path% for where.exe

Grab the ‘/max’ window with the mouse and its height shrinks to normal! But if instead one does this: hold down ALT, tap spacebar, release ALT, tap ‘m’, tap an arrow one or more times:[ENT]: then the newly spawned ‘/max’ window will stay ‘maxxed.’

using where.exe in N:\some_folder

The resulting %path% (display by echo %path%) applies only to the CMD window where the specified path %cd%;%path% command is executed -- and to any more CMD windows which one ‘spawns’ from that same CMD window after setting the new %path%. I like to ‘spawn’ another CMD window like this:

start /max cmd /k

because the resulting large window does a good job at displaying such console applications (freeware) as the VDE Editor (similar to WordStar) or Nano. Before I spawn a new CMD, I first set CMD font to e.g. Lucida Console or (Win 7) Consolas 22, Buffer size to 999 and tick Quick Edit Mode.

Solution 2:

@echo off
setlocal enabledelayedexpansion
set var_a=%1
call :sub %var_a%
if exist %var_b% goto exit
for %%i in ( .com .exe .cmd .bat) do (
 call :sub %var_a%%%i
 if exist !var_b! goto exit
)
echo INFO: could not find files for the given pattern(s) 1>&2 
set "var_a="
set "var_b="
exit /b 1

:sub
set var_b=%~$PATH:1
goto :EOF

:exit
echo %var_b%
set "var_a="
set "var_b="
exit /b 0

EDIT:

With this simple code, you can create your custom function of "where" you are looking for executable files (.com .exe .bat) in the directories listed in the PATH environment variable.

  • Create a file called whereis.bat
  • Insert the code above and save the file.
    (You can save this file in the Windows PATH to run the command from anywhere)

To use the command:

C:\>whereis notepad

the result:

C:\Windows\System32\notepad.exe

Solution 3:

where.exe used to be included with Windows Resource Kits, but has been removed after inclusion to Windows Server 2003 (the OS). It's also part of Visual Studio SDK.

Solution 4:

I liked the "whereis.bat" solution Claus suggested.

I just had one problem with it on one occasion, when the file you're looking for has spaces in it. Eg:

whereis.bat "my test.bat"

Results in:

INFO: could not find files for the given pattern(s)

To solve this, I added quotation marks around %var_b% on this line within the batch-file:

if exist "%var_b%" goto exit

Then I get the output I was hoping for:

C:\Windows\System32\my test.bat