8

I'm looking for a link to download where.exe tool for Windows XP. It looks like this tool should be included in Windows 2000 Resource Kit but I can't find any links to download this Resource Kit. I also checked Windows Server 2003 Resource Kit Tools and Windows XP Service Pack 2 Support Tools but neither of them has where.exe according to the list of contents.

4

4 Answers 4

5

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.

3
  • 1
    next time update your previous answer, rather than posting three after eachother :-)
    – Ivo Flipse
    Feb 24, 2011 at 19:27
  • 1
    Side note: Version of where.exe marked as Windows vista 64bit sp2 Ultimate on dllexedown.com is the same (when comparing exe files) as the 32bit version of where.exe in my Vista Professional 64bit yet they behave differently! My version when run without arguments prints ERROR: The operation completed successfully. Type "WHERE /?" for usage help. and when run as where /? it prints help. The version from dllexedown.com when run without arguments prints The operation completed successfully. and when run as where /? it prints nothing. Feb 24, 2011 at 20:08
  • In the command prompt, right click on the window's title bar and select "Defaults" - there you can set the default size and position for cmd.exe. I prefer 180x80 for the window size, and 180x9999 for the screen buffer size. Depends on the size of your monitor and how much memory you want to waste with such long scrollback buffers :) Mar 25, 2013 at 0:40
3
@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
0
2

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.

1
  • Yup. I just copy it (along with a handful of other useful tools, like forfiles.exe) from a Windows Server 2003 installation.
    – afrazier
    Feb 24, 2011 at 15:36
1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .