Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
Will which do? –  Ignacio Vazquez-Abrams Feb 24 '11 at 10:12
    
@Ignacio Vazquez Abrams What which do you have in mind? There's no which.exe in above kits. which is available on Linux not Windows. –  Piotr Dobrogost Feb 24 '11 at 10:47
    
Except you're wrong. gnuwin32.sourceforge.net/packages/which.htm –  Ignacio Vazquez-Abrams Feb 24 '11 at 10:50
    
@Ignacio Vazquez Abrams That's the port of tool from Linux. There's "native" Windows version Finding files in Windows 2000 Pro with the Where.exe utility but I can't find where to download it from. –  Piotr Dobrogost Feb 24 '11 at 11:05

4 Answers 4

up vote 5 down vote accepted

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.

share|improve this answer
    
+1, Nice site Roger, thanks. –  Moab Feb 24 '11 at 16:32
1  
next time update your previous answer, rather than posting three after eachother :-) –  Ivo Flipse Feb 24 '11 at 19:27
    
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. –  Piotr Dobrogost Feb 24 '11 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 :) –  Wayne Uroda Mar 25 '13 at 0:40

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.

share|improve this answer
    
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 '11 at 15:36
@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
share|improve this answer

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.