The Unix which statement is very useful in determening which path is used for program run from the command line, and it would be very helpful to have something similar in windows.
Save this to a file named
@for %%e in (%PATHEXT%) do @for %%i in (%1%%e) do @if NOT "%%~$PATH:i"=="" echo %%~$PATH:i @for %%i in (%1) do @if NOT "%%~$PATH:i"=="" echo %%~$PATH:i
Or download UnxUtils - they have lightweight native ports of the most common tools.
Or if you don't care about lightweightness, install Microsoft Services For Unix. Yes, it has Microsoft Vi.
I use whereis written by Joseph M. Newcomer (co-author of Win32 Programming).